Chris Taylor wrote:
> Hi,
>
> You did not specify the language so I will assume C#, a simple cast
> will do the job
> int c = (int)'a';
> You can also use the Convert class
> int c = Convert.ToInt32('a');
>
> For VB.NET the Convert class will work or you can use the VB.NET
> implementation of Asc().
>
> Hope this helps
This will return the character's Unicode codepoint, which is not
necessarily the same as the character's byte value in ANSI encoding --
whatever that's suppoed to be. Windows-1250? -1251? -1252?
To encode characters, use a appropriate System.Text.Encoding instance
instead
Cheers,
--
http://www.joergjooss.de
mailto:news-(E-Mail Removed)