Unrecognized escape sequence

Posted on 2005-04-12
Last Modified: 2010-05-18
Why doesnt this code work ?

string strDHLURL = "HTTPS:\\";

I get this error "Unrecognized escape sequence"

Question by:sean-keys
    LVL 2

    Accepted Solution

    The \ character is a escape character.

    You will need to do one of the following...

    1.  Change your string to:  "HTTPS:\\\\";
    2.  Add a @ symbol in front of the string:  @"HTTPS:\\";

    This should solve your problem.

    Author Comment

    Do both options do the exact same thing?  I'm new to c#.

    LVL 2

    Expert Comment

    Yes.  The @ simply tells the compiler to ignore any escape characters

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now