How to cast a int to a string?

Chris Pons cmpons at gmail.com
Tue Mar 6 15:28:40 PST 2012


On Tuesday, 6 March 2012 at 23:19:03 UTC, H. S. Teoh wrote:
> On Wed, Mar 07, 2012 at 12:13:54AM +0100, Chris Pons wrote:
>> I'm trying to update a string easily whenever I change a 
>> numeric
>> component of the string. I've tried to do this so far with no
>> result:
> [...]
>
> Try this:
>
> 	import std.conv;
> 	...
> 	int i = 1234;
> 	string s = to!string(i);
>
>
> T

Thanks, that did the trick.


More information about the Digitalmars-d-learn mailing list