Ascii string literal.

Anonymouse via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 6 14:39:35 PDT 2016


On Friday, 6 May 2016 at 20:29:35 UTC, Adam D. Ruppe wrote:
> On Friday, 6 May 2016 at 20:01:27 UTC, Alexandru Ermicioi wrote:
>> Is it possible somehow to convert implicitly a string literal
>
> Not implicitly (well, unless you just use string, ascii is a 
> strict subset of utf-8 anyway), but you could do it explicitly 
> easily.
>
> immutable(ubyte)[] ascii(string s) { return 
> cast(typeof(return)) s; }

Is this different from what std.string.representation does?


More information about the Digitalmars-d-learn mailing list