prefixDigit

fnstring prefixDigit(string name, string prefix) @safe pure nothrow

Prefixes name with prefix when it would otherwise start with a digit (no D identifier can).

Parameters

namethe candidate identifier.
prefixthe prefix to use (a generator's choice, e.g. "n" for enum items or "_" for module names).

Returns

prefix ~ name when name is empty or starts with an

ASCII digit, name otherwise; 2 with prefix n -> n2.