2, 8, 10, 16
character type for output
lower for deadbeef, upper for DEADBEEF
integer to convert. Can be ubyte, ushort, uint or ulong. If radix is 10, can also be byte, short, int or long.
Random access range with slicing and everything
import std.algorithm.comparison : equal; assert(toChars(1).equal("1")); assert(toChars(1_000_000).equal("1000000")); assert(toChars!(2)(2U).equal("10")); assert(toChars!(16)(255U).equal("ff")); assert(toChars!(16, char, LetterCase.upper)(255U).equal("FF"));
Convert integer to a range of characters. Intended to be lightweight and fast.