Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What are ASC() and CHR() in C#?
Message
De
08/04/2004 12:25:55
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00893241
Message ID:
00893311
Vues:
13
This message has been marked as a message which has helped to the initial question of the thread.
>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.

I'm not realy familiar with C#, my experience is primarily with VB.NET, but I might be able to shed a tiny bit of light on your problem... :)

Use [] to access individual characters of a string, like myString[0].
Use single quotes to specify character literals, like 'x'.
Use escape sequences (backslash (\) followed by an escape code) in the single quotes to specify any characters, like '\u000A' or '\n'. Both represent the newline character. Look in the help under "character literals" for more information.

Hope this either helps you, or sends you down the right (or at least new) roads toward your solution.
-----
Lee Perkins
TigerBase Technologies

"Lee is one that would plug his brain into the internet, if he could, and STILL scream for more" - Very good friend of Lee's
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform