Return ASCII value as uint

Alexander Panek alexander.panek at brainsware.org
Tue May 8 09:25:37 PDT 2007


On Tue, 08 May 2007 11:27:40 -0400
okibi <okibi at ratedo.com> wrote:

> Hey,
> 
> I was wondering if D has a simple function to return the ASCII value
> of a character as a uint, much like ord() does in php.
> 
> Thanks!

Shouldn't a cast be sufficiant?

char c = 'a';
uint i = cast(uint)c;


More information about the Digitalmars-d-learn mailing list