Is this what you're after?

import std.string;
void main()
{
    auto str = format("%.4s", 4);
    assert(str == "0004");
}

Reply via email to