Is there a set of character class predicates in the standard library? I’m looking for something like the following?
c.isDigit c.isAlphaNumeric c.isUpperCase c.isPunctuation c.isWhiteSpace c.isEndOfLine c.isPrintable
Without such predicates, I’m putting expressions like the following in my code, which of course works for my needs, but there’s probably a better way. AND I can detect end of line in UNIX with
c == '\n', but that may not work on other operating systems.
val digits = Set('0','1','2','3','4','5','6','7','8','9') if ( digits.contains(c)) ... else ...