Re: Converting string to ascii value

2014-03-07 Thread Nick Sabalausky
On 3/7/2014 5:33 PM, H. S. Teoh wrote: long x = cast(ubyte) stringarray[0]; long x = cast(ubyte) stringarray[0][0]; ;)

Re: Converting string to ascii value

2014-03-07 Thread Nick Sabalausky
On 3/7/2014 5:37 PM, Setra wrote: Thanks! Now I feel kind of dumb. For some reason I thought it would not be that simple... In a lot of languages it isn't that simple ;)

Re: Converting string to ascii value

2014-03-07 Thread Nick Sabalausky
On 3/7/2014 5:21 PM, Setra wrote: Hello all! I am having trouble converting a letter in a array of string to the ascii value. For example: First of all: string[] stringarray[3]; This isn't your main problem, but that line is incorrect. Actually, I'm kinda surprised that even works. It sho

Re: Converting string to ascii value

2014-03-07 Thread Setra
Thanks! Now I feel kind of dumb. For some reason I thought it would not be that simple...

Re: Converting string to ascii value

2014-03-07 Thread Setra
On Friday, 7 March 2014 at 22:21:06 UTC, Setra wrote: 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[2] = "5"; long y = to!long(stringarray[2]);

Re: Converting string to ascii value

2014-03-07 Thread H. S. Teoh
On Fri, Mar 07, 2014 at 10:21:57PM +, Setra wrote: > On Friday, 7 March 2014 at 22:21:06 UTC, Setra wrote: > >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"; > >string

Re: Converting string to ascii value

2014-03-07 Thread Ali Çehreli
On 03/07/2014 02:21 PM, Setra wrote: > On Friday, 7 March 2014 at 22:21:06 UTC, Setra wrote: >> Hello all! I am having trouble converting a letter in a array of >> string to the ascii value. For example: >> >> string[] stringarray[3]; That is three string slices, not three strings. This works fo

Converting string to ascii value

2014-03-07 Thread Setra
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]