Relates :
|
It seems strange to have the methods Character.isJavaIdentifierStart and Character.isJavaIdentifierPart and yet there is no method String.isJavaIdentifier which would look something like this public boolean isJavaIdentifier() { int n = length(); if (n==0) return false; if (!Character.isJavaIdentifierStart(charAt(0))) return false; for (int i = 1; i < n; i++) if (!Character.isJavaIdentifierPart(charAt(i))) return false; return true; }
|