digitalmars.D.learn - Conversion (silly question, sorry)
- renoir <renato rexlen.it> Jan 01 2008
- Derek Parnell <derek psych.ward> Jan 01 2008
- "Jarrett Billingsley" <kb3ctd2 yahoo.com> Jan 01 2008
- Bill Baxter <dnewsgroup billbaxter.com> Jan 01 2008
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...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.
Or get std2 from dsource and use things like std2.conv.to!(double)(s). http://www.dsource.org/projects/std2 --bb
Jan 01 2008









Derek Parnell <derek psych.ward> 