Solved

escape sequences

Posted on 2004-09-08
6
1,328 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:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Suggested Solutions

Title # Comments Views Activity
Where does legacy ASP.NET initialize language? 2 102
Unlocking a column in excel using C# 17 33
ASP.NET data base connection 35 94
Send parameters via datatable ajax call 4 43
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

734 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