How to convert a LPCWSTR aka const(wchar)* to string

Vinod K Chandran kcvinu82 at gmail.com
Tue May 10 01:25:14 UTC 2022


On Tuesday, 10 May 2022 at 01:07:37 UTC, Mike Parker wrote:
>
> ```d
> import std.conv : to;
> string s = to!string(pszUserString);
> ```
>
Thanks, it worked. At first, I tried `to!string` but it failed 
because of this usage--
```d
this(LPCWSTR dtpStr) { this.dateString = 
to!string(LPCWSTR)(dtpStr) ; }
```




More information about the Digitalmars-d-learn mailing list