The string to check.
true if the string is a valid Twitch username; false if not.
{ enum username = "zorael"; assert(username.isValidTwitchUsername); } { enum username = "zårael"; assert(!username.isValidTwitchUsername); } { enum username = "zorael_"; assert(username.isValidTwitchUsername); } { enum username = "zorael-"; assert(!username.isValidTwitchUsername); } { enum username = "z0rael"; assert(username.isValidTwitchUsername); } { enum username = "z0r"; assert(!username.isValidTwitchUsername); } { enum username = string.init; assert(!username.isValidTwitchUsername); } { enum username = "1234567890123456789012345"; assert(username.isValidTwitchUsername); } { enum username = "12345678901234567890123456"; assert(!username.isValidTwitchUsername); } { enum username = "#zorael"; assert(!username.isValidTwitchUsername); }
Checks if a string is a valid Twitch username.
They must be 4 to 25 characters and may only contain letters, numbers and underscores.