Converting string to ascii value
Setra
roederharpo at hushmail.com
Fri Mar 7 14:21:04 PST 2014
Hello all! I am having trouble converting a letter in a array of
string to the ascii value. For example:
string[] stringarray[3];
stringarray[0] = "blahblahblah";
stringarray[1] = "a";
stringarray[3] = "5";
long y = to!long(stringarray[2]); // makes y the value 5
long x = to!long(stringarray[1]); // errors
This is not working properly. I want to get the ascii value of
the characters.
In this case y should equal 97, b should equal 53. How do I do
this properly?
Thanks!
More information about the Digitalmars-d-learn
mailing list