Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

escape sequences

Posted on 2004-09-08
6
Medium Priority
?
1,331 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 1200 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Assisted Solution

by:elfraga
elfraga earned 400 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 400 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

609 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