digitalmars.D.learn - toString(char*)?
- Lutger (3/3) Oct 11 2010 Where can I find the function to convert from c-style string to a normal...
- Lars T. Kyllingstad (5/10) Oct 11 2010 import std.conv;
- Lutger (2/16) Oct 11 2010 Oh wow, I didn't knew that would work. Awesome.
- Lars T. Kyllingstad (4/22) Oct 11 2010 I don't think it works the other way, though, you still have to use
- Tomek =?UTF-8?B?U293acWEc2tp?= (5/7) Oct 11 2010 Most (all?) conversions in std.conv implement the whole round-trip, ther...
Where can I find the function to convert from c-style string to a normal D string? It used to be toString in std.string, but that one is deprecated. Thanks.
Oct 11 2010
On Mon, 11 Oct 2010 21:46:26 +0200, Lutger wrote:Where can I find the function to convert from c-style string to a normal D string? It used to be toString in std.string, but that one is deprecated. Thanks.import std.conv; const char* cString; string dString = to!string(cString) -Lars
Oct 11 2010
Lars T. Kyllingstad wrote:On Mon, 11 Oct 2010 21:46:26 +0200, Lutger wrote:Oh wow, I didn't knew that would work. Awesome.Where can I find the function to convert from c-style string to a normal D string? It used to be toString in std.string, but that one is deprecated. Thanks.import std.conv; const char* cString; string dString = to!string(cString) -Lars
Oct 11 2010
On Mon, 11 Oct 2010 22:00:37 +0200, Lutger wrote:Lars T. Kyllingstad wrote:I don't think it works the other way, though, you still have to use std.string.toStringz(). -LarsOn Mon, 11 Oct 2010 21:46:26 +0200, Lutger wrote:Oh wow, I didn't knew that would work. Awesome.Where can I find the function to convert from c-style string to a normal D string? It used to be toString in std.string, but that one is deprecated. Thanks.import std.conv; const char* cString; string dString = to!string(cString) -Lars
Oct 11 2010
Lars T. Kyllingstad napisaĆ:I don't think it works the other way, though, you still have to use std.string.toStringz().Most (all?) conversions in std.conv implement the whole round-trip, there's no reason for string <-> char* to be any different. File a bug and see what happens. -- Tomek
Oct 11 2010