toString(char*)?

Lutger lutger.blijdestijn at gmail.com
Mon Oct 11 13:00:37 PDT 2010


Lars T. Kyllingstad wrote:

> 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

Oh wow, I didn't knew that would work. Awesome. 


More information about the Digitalmars-d-learn mailing list