bugGNU source-highlight - Bugs: bug #34177, C# Verbatim String Literals


bug #34177: C# Verbatim String Literals

Submitted by:  John Gietzen <otac0n>
Submitted on:  Tue 30 Aug 2011 08:52:59 PM UTC  
Votes:  100  
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Tue 30 Aug 2011 08:52:59 PM UTC, original submission:  

In the C# language file, the only supported strings are C++ style strings.  However, C# has a string format called "Verbatim String Literals.":

    string foo = "a\\b\\c";

is equivalent to:

    string foo = @"a\b\c";


    string bar = "a\"b\"c";

is equivalent to:

    string bar = @"a""b""c";

Basically, any character other than a double-quote is handled as though it is part of the string.  Double-quotes are doubled-up to  encode a double-quote character.

The EBNF for string literals in C# is available here:

John Gietzen <otac0n>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by philomelus (Voted in favor of this item)
  • -email is unavailable- added by otac0n (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 100 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-08-29 philomelus Carbon-Copy- => Added philomelus

    Back to the top

    Powered by Savane 3.7