boolisNumeric
fn
bool isNumeric(S)(S s, bool bAllowSep = false) if (isSomeString!S ||
(isRandomAccessRange!S &&
hasSlicing!S &&
isSomeChar!(ElementType!S) &&
!isInfinite!S))Takes a string s and determines if it represents a number. This function also takes an optional parameter, bAllowSep, which will accept the separator characters `','` and '__' within the string. But these characters should be stripped from the string before using any of the conversion functions like to!int(), to!float(), and etc else an error will occur.
Also please note, that no spaces are allowed within the string anywhere whether it's a leading, trailing, or embedded space(s), thus they too must be stripped from the string before using this function, or any of the conversion functions.
Parameters
s | the string or random access range to check |
bAllowSep | accept separator characters or not |