How do you get a hexstring from a base10 string -or- from a number?

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 3 16:30:12 PST 2016


On 04.02.2016 00:45, Enjoys Math wrote:
> On Wednesday, 3 February 2016 at 23:43:45 UTC, Enjoys Math wrote:
> body { // is currently:
>    return to!string(this.toHash());
> }
>
> and is returning a base10 string, so how would I return a hex string so
> I can compare numbers displayed to the debugger addresses in visual D?

to!string has an optional radix (aka base) parameter:

   return to!string(this.toHash(), 16);


More information about the Digitalmars-d-learn mailing list