Convert multibyte `string` to `dstring`

Stanislav Blinov stanislav.blinov at gmail.com
Sun Nov 25 21:33:15 UTC 2018


On Sunday, 25 November 2018 at 21:23:31 UTC, Vladimirs Nordholm 
wrote:

> Is there a proper way to convert a string with multibyte 
> characters into a dstring?

void main() {
     import std.conv : to;
     import std.stdio : writeln;
	string a = "abc😃123";
     auto b = to!dstring(a);
     assert(b.length == 7);
     writeln(b);
}


More information about the Digitalmars-d-learn mailing list