Char Enumerator

G

Guest

In C# is there some sort of Enumerator which has "friendly" names for things like line feed, tabs, carriage control, etc.? I would perfer to use then using ascii values as I think this is more self documenting...
 
B

bruce barker

C# like c/java/javascript has the time honored literal values

\n = new line (
\r = carriage return
\t = tab
see docs for more

you can make you own class with string props for the names if you want, but
then string constants would be as hard to read as the vb ones:

string s = StringValues.TAB + "this is line 1 " + StringValues.NewLine
+ StringValues.TAB + "this is line 1 " + StringValues.NewLine;

instead of:

string s = "\tthis is line1\r\n\tthis is line 2\r\n";

-- bruce (sqlwork.com)


Jim Heavey said:
In C# is there some sort of Enumerator which has "friendly" names for
things like line feed, tabs, carriage control, etc.? I would perfer to use
then using ascii values as I think this is more self documenting...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top