Logo

Programming-Idioms

History of Idiom 142 > diff from v3 to v4

Edit summary for version 4 by BBaz:
New D implementation by user [BBaz]

Version 3

2016-08-14, 16:29:47

Version 4

2016-08-14, 20:00:25

Idiom #142 Hexadecimal digits of an integer

Assign to string s the hexadecimal representation (base 16) of integer x.

E.g. 999 -> "3e7"

Idiom #142 Hexadecimal digits of an integer

Assign to string s the hexadecimal representation (base 16) of integer x.

E.g. 999 -> "3e7"

Extra Keywords
hex hexa
Extra Keywords
hex hexa
Imports
std.conv;
Code
s = to!string(x, 16);
Comments bubble
std.conv.to is the entry point for any standard convertion.
Doc URL
https://dlang.org/phobos/std_conv.html#.to