digitalmars.D.learn - Conversion (silly question, sorry)
- renoir (3/3) Jan 01 2008 Sorry for the silly question:
- Derek Parnell (10/13) Jan 01 2008 Have a look at the std.conv module.
- Jarrett Billingsley (4/7) Jan 01 2008 If you're using D1, use std.string.toString to convert most basic types ...
- Bill Baxter (4/12) Jan 01 2008 Or get std2 from dsource and use things like std2.conv.to!(double)(s).
Sorry for the silly question: how can i convert from string to int? And viceversa from int to string? Thx.
Jan 01 2008
On Tue, 01 Jan 2008 18:32:32 -0500, renoir wrote:Sorry for the silly question: how can i convert from string to int? And viceversa from int to string? Thx.Have a look at the std.conv module. string s; double f; s = std.conv.to!(string)(23.45); f = std.conv.to!(double)(s); -- Derek Parnell Melbourne, Australia skype: derek.j.parnell
Jan 01 2008
"renoir" <renato rexlen.it> wrote in message news:fleiig$28gg$1 digitalmars.com...Sorry for the silly question: how can i convert from string to int? And viceversa from int to string? Thx.If you're using D1, use std.string.toString to convert most basic types to strings and std.conv.toInt to convert from strings to ints.
Jan 01 2008
Jarrett Billingsley wrote:"renoir" <renato rexlen.it> wrote in message news:fleiig$28gg$1 digitalmars.com...Or get std2 from dsource and use things like std2.conv.to!(double)(s). http://www.dsource.org/projects/std2 --bbSorry for the silly question: how can i convert from string to int? And viceversa from int to string? Thx.If you're using D1, use std.string.toString to convert most basic types to strings and std.conv.toInt to convert from strings to ints.
Jan 01 2008