Solved

escape sequences

Posted on 2004-09-08
6
1,326 Views
Last Modified: 2012-08-13
Where can I find a list of escape characters that work in C#:

"\n"    RETURN
"\t"     TAB

etc., etc.

???
0
Comment
Question by:knowlton
  • 3
  • 2
6 Comments
 
LVL 15

Accepted Solution

by:
Timbo87 earned 300 total points
ID: 12012067
Here's a good list.
http://www.wilsonmar.com/1eschars.htm
It's not C# specific, but C# uses the same escape characters.
0
 
LVL 10

Expert Comment

by:eternal_21
ID: 12012108
0
 
LVL 1

Expert Comment

by:elfraga
ID: 12012131
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 1

Assisted Solution

by:elfraga
elfraga earned 100 total points
ID: 12012136
here they are:

Escaped character Description
ordinary characters Characters other than . $ ^ { [ ( | ) * + ? \ match themselves.
\a Matches a bell (alarm) \u0007.
\b Matches a backspace \u0008 if in a [] character class; otherwise, see the note following this table.
\t Matches a tab \u0009.
\r Matches a carriage return \u000D.
\v Matches a vertical tab \u000B.
\f Matches a form feed \u000C.
\n Matches a new line \u000A.
\e Matches an escape \u001B.
\040 Matches an ASCII character as octal (up to three digits); numbers with no leading zero are backreferences if they have only one digit or if they correspond to a capturing group number. (For more information, see Backreferences.) For example, the character \040 represents a space.
\x20 Matches an ASCII character using hexadecimal representation (exactly two digits).
\cC Matches an ASCII control character; for example, \cC is control-C.
\u0020 Matches a Unicode character using hexadecimal representation (exactly four digits).
\ When followed by a character that is not recognized as an escaped character, matches that character. For example, \* is the same as \x2A.
0
 
LVL 10

Assisted Solution

by:eternal_21
eternal_21 earned 100 total points
ID: 12012233
Sorry Tom, my previous posted link was for Regular Expressions in .NET...  Here is the OFFICIAL defination (i.e.: from the ECMA C# Language Specification):

http://msdn.microsoft.com/vcsharp/team/language/default.aspx
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf (See 9.4.4.4 Character Literals, Page 75)

The Simple escape sequences:

  \'  Single quote (\x 0027)
  \"  Double quote  (\x0022)
  \\  Backslash  (\x005C)
  \0  Null  (\x0000)
  \a  Alert  (\x0007)
  \b  Backspace  (\x0008)
  \f  Form feed  (\x000C)
  \n  New line  (\x000A)
  \r  Carriage return  (\x000D)
  \t  Horizontal tab (\x0009)
  \v  Vertical tab (\x000B)

The Unicode escape sequences:

  \u  hex-digit hex-digit hex-digit hex-digit
  \U  hex-digit hex-digit hex-digit hex-digit hex-digit hex-digit hex-digit hex-digit

The Hexidecimal escape sequence:

  \x  hex-digit [hex-digit] [hex-digit] [hex-digit]
0
 
LVL 10

Expert Comment

by:eternal_21
ID: 12012236
Uh.. make that "definition"... when's EE going to get a spell-checker anyway? :)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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