Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What are ASC() and CHR() in C#?
Message
 
 
To
08/04/2004 12:27:31
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00893241
Message ID:
00893334
Views:
19
Jason,
Thank you so much for your help.
Applying your example helped solve my problem.


>Dmitry,
>
>Depending on what you're doing with both of these requests, I suggest you look at RegEx (In System.Text namespace). It may be overkill for some of what you need, but it's invaluable for searching and replacing different sections of a string. And if you have a definable pattern you're seeking, it's faster than traversing a string character by character.
>
>String.Replace accepts escape characters:
>
>string newLineString = "Some text with a CHR(10)";
>newLineString = newLineString.Replace("\n", "I'm a newline character");
>
>string crString = "Text with a CHR(13)";
>crString = crString.Replace("\r", "I'm a carriage return");
>
>
>If you need both, there's Environment.NewLine (In the System namespace). Search help on Environment.NewLine for examples.
>
>Hope that helps,
>---J
>
>
>>I need to see what is inside a string in C# code. In VFP I would parse the string and look at each character using ASC() function. What is the equivalent of this function in C#?
>>
>>Also, C# has a string method .Replace() which allows to replace one character with another. If I wanted to replace character CHR(13) or CHR(10) in a string with something different, how would I use it in the .Replace() method of C#?
>>
>>Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform