#498 closed enhancement (invalid)
Add character categorization isDigit, isLetter, etc
Reported by: | Owned by: | anonymous | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | General | Version: | 0.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
For character parsing and categorization, the following functions would be useful. I'm proposing a dojo.char namespace, but I guess dojo.string would be fine too:
- isDigit(ch): True if the char is a digit: [0-9].
- isLetterOrDigit(ch): True if the char is a letter or digit: [A-Z]|[a-z]|[0-9].
- isLowerCase(ch): True if the char is a lowercase letter: [a-z].
- isUpperCase(ch): True if the char is an uppercase letter: [A-Z].
- isWhitespace(ch): True if the char is a whitespace: [s].
Notice that most of this regular expressions aren't Unicode enabled. But it would be better if they are.
Note: See
TracTickets for help on using
tickets.
Interesting, but not sure why you would do this when the Regular Expression engine is available anywhere (with Unicode support); this functionality is already a part of JS.
Closing the ticket. Thanks for the thought, though.