Integer to String

Frank Benoit keinfarbton at googlemail.com
Wed Jan 30 07:57:24 PST 2008


tytower schrieb:
> I'm pulling my hair out to simply take a number say 37 and convert it to a string under Tango
> 
> int x = 37
> Char[] y = intToString(x);
> 
> how the blazes do I make this simple little thing work??

In addtion to what others said, you can use the Convert module, that
does type convertions between various types. It uses the
to!( TargetType )
template function


import tango.util.Convert;

int x = 37
char[] y = to!(char[])(x);


More information about the Digitalmars-d-learn mailing list