?
Solved

escape sequences

Posted on 2004-09-08
6
Medium Priority
?
1,330 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
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 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

Technology Partners: 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!

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

764 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