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

 
 

bug #34177: C# Verbatim String Literals

Submitter:  John Gietzen <otac0n>
Submitted:  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
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       No canned response available

 

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";

and

    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:
http://msdn.microsoft.com/en-us/library/aa691090%28v=vs.71%29.aspx

John Gietzen <otac0n>

 

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

Attach Files:
   
   
Comment:
   

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)
  •  

    There are 100 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    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.9