| Thread overview | ||||||
|---|---|---|---|---|---|---|
|
March 13, 2013 UTF escape | ||||
|---|---|---|---|---|
| ||||
Html has &#xxx to access fonts at xxx, does D have something similar?
writeln("a");
to
writeln(a);
Thanks.
| ||||
March 13, 2013 Re: UTF escape | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Stephen Jones | On Wednesday, 13 March 2013 at 21:59:54 UTC, Stephen Jones wrote: > Html has &#xxx to access fonts at xxx, does D have something similar? > > writeln("a"); > > to > > writeln(a); > > Thanks. No but you can easily create this on your own: import std.string; import std.stdio; string[dchar] transTable; shared static this() { transTable = ['a' : "a", 'b' : "b"]; } void main() { string input = "afoo bfoo"; writeln(input.translate(transTable)); } | |||
March 13, 2013 Re: UTF escape | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Stephen Jones | On Wednesday, 13 March 2013 at 21:59:54 UTC, Stephen Jones wrote:
> Html has &#xxx to access fonts at xxx, does D have something similar?
>
> writeln("a");
>
> to
>
> writeln(a);
>
> Thanks.
What Andrej said or you can use the unicode escapes (they are in hexadecimal):
writeln("\u0061");
| |||
March 13, 2013 Re: UTF escape | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Stephen Jones | And there's actually some named entities like
writeln("\© 2014");
works in D.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply