Character to compare with the list of accepted characters in a nickname.
true if the character is in the list of valid characters for nicknames, false if not.
assert('a'.isValidNicknameCharacter); assert('9'.isValidNicknameCharacter); assert('`'.isValidNicknameCharacter); assert(!(' '.isValidNicknameCharacter));
import std.string : representation; { enum line = "abcDEFghi0{}29304_[]`\\^|---"; foreach (immutable char c; line.representation) { assert(c.isValidNicknameCharacter, c ~ ""); } } { enum line = "åÄö高所恐怖症123なにぬねの "; foreach (immutable char c; line.representation) { assert(!c.isValidNicknameCharacter, c ~ ""); } }
Returns whether or not a passed char can be part of a nickname.
The IRC standard describes nicknames as being a string of any of the following characters:
[a-z] [A-Z] [0-9] _-\\[]{}^\|`