Converting between string and const char*

Robert Clipsham robert at
Wed Mar 3 12:02:05 PST 2010

Hi all,

I'm playing with D2/Phobos, and was wondering what the right way to 
convert between const char* and string is? In D1/Tango I could use 
toStringz() and fromStringz() from tango.stdc.stringz, I can only find 
an equivalent for toStringz in D2/Phobos though, in std.string. What can 
I use as a replacement to tango's fromStringz, or will I need to roll my 
own? I also tried using!(), but that doesn't seem to support 
converting between them.


More information about the Digitalmars-d-learn mailing list