Would you like to answer one of these unanswered questions instead? I thought its for a-z, A-Z and 0-9 only? The preceding code is wrong because it works only with English and a few other languages.
For example, there are at least 4 code blocks for Cyrillic characters and 7 for Latin. Characters in Java are all Unicode based. This function I think is what most developers are looking for:. Stephen C Stephen C 521k 70 578 937.
Thank you for your interest in this question. StephenC I thought Character.
Note that any code point will be in at most one block. ChuanRocks ChuanRocks 1,035 1 13 19. The OP asked for "an A-z letter"...
Use Character. Dead links for the javadocs. Unless we are talking about internationalization? To internationalize the previous example, replace it with the following statements: So we are not talking about other languages are we?
As the answers indicate if you examine them carefully! UnicodeBlock class defines static constants for well-known blocks; see the javadocs. Hot Network Questions.
I'm looking for a function that checks only if it's one of the Latin letters or a decimal number. Thanks for letting me know.
Then check the Unicode specs for what code-points the respective character classes actually contain.