Convert wchar* to wstring?

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Apr 5 03:35:41 PDT 2016


On Tuesday, 5 April 2016 at 07:10:50 UTC, tsbockman wrote:

> You can also combine both steps into a one-liner:
>
>     wstring wstr = cw[0 .. cw_len].idup;

This should do the trick, too:

import std.conv : to;
auto wstr = to!wstring(cw);


More information about the Digitalmars-d-learn mailing list