Regarding hex strings
Dejan Lekic
dejan.lekic at gmail.com
Mon Oct 22 04:14:21 PDT 2012
>
> If you want vastly human readable, you want heredoc hex syntax,
> something like this:
>
> ubyte[] = x"<<END
> 32 2b 32 3d 34 2e 20 32 2a 32 3d 34 2e 20 32 5e
> 32 3d 34 2e 20 54 68 65 72 65 66 6f 72 65 2c 20
> 2b 2c 20 2a 2c 20 61 6e 64 20 5e 20 61 72 65 20
> 74 68 65 20 73 61 6d 65 20 6f 70 65 72 61 74 69
> 6f 6e 2e 0a 22 36 34 30 4b 20 6f 75 67 68 74 20
> 74 6f 20 62 65 20 65 6e 6f 75 67 68 22 20 2d 2d
> 20 42 69 6c 6c 20 47 2e 2c 20 31 39 38 34 2e 20
> 22 54 68 65 20 49 6e 74 65 72 6e 65 74 20 69 73
> 20 6e 6f 74 20 61 20 70 72 69 6d 61 72 79 20 67
> 6f 61 6c 20 66 6f 72 20 50 43 20 75 73 61 67 65
> END";
>
Having a heredoc syntax for hex-strings that produce ubyte[]
arrays is confusing for people who would (naturally) expect a
string from a heredoc string. It is not named hereDOC for no
reason. :)
More information about the Digitalmars-d
mailing list