Is there an equivalent Java function that the same as the C99 Standard function 'ispunct()'?
http://linux.die.net/man/3/ispunct
The functions returns true
if and only if the character is a punctuation mark.
Is there an equivalent Java function that the same as the C99 Standard function 'ispunct()'?
http://linux.die.net/man/3/ispunct
The functions returns true
if and only if the character is a punctuation mark.
Try this (from this link):
public static boolean isPunct(final char c) {
final int val = (int)c;
return val >= 33 && val <= 47
|| val >= 58 && val <= 64
|| val >= 91 && val <= 96
|| val >= 123 && val <= 126;
}