isValidKey

Test whether the string is valid key, i.e. does not need escaping, is not a comment and not empty string.

@nogc @safe pure nothrow
bool
isValidKey
(
in char[] key
)

Examples

assert(isValidKey("Valid key"));
assert(!isValidKey(""));
assert(!isValidKey("    "));
assert(!isValidKey("Sneaky\nKey"));
assert(!isValidKey("# Sneaky key"));
assert(!isValidKey("Sneaky=key"));

Meta