https://issues.dlang.org/show_bug.cgi?id=19982
shove <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from shove <[email protected]> --- I think the function you want is: std.string.leftJustify(), std.string. rightJustify(). -------------------------------- std.range.padLeft() is normal, and it returns a range. The assert in the source file and the four lines I added are as follows: -------------------------------- import std.algorithm.comparison : equal; assert([1, 2, 3, 4].padLeft(0, 6).equal([0, 0, 1, 2, 3, 4])); assert([1, 2, 3, 4].padLeft(0, 3).equal([1, 2, 3, 4])); assert("abc".padLeft('_', 6).equal("___abc")); assert("a string".padLeft('0', 10).equal("00a string")); assert("a string".padLeft('0', 10).equal([48, 48, 97, 32, 115, 116, 114, 105, 110, 103])); assert("a string".padLeft(dchar('0'), 10).equal("00a string")); assert("a string".padLeft(dchar('0'), 10).equal([48, 48, 97, 32, 115, 116, 114, 105, 110, 103])); --
