In Java, find if the first character in a string is upper case without using regular expressions.
Assuming s is non-empty:
s
Character.isUpperCase(s.charAt(0))
or, as mentioned by divec, to make it work for characters with code points above U+FFFF:
U+FFFF
Character.isUpperCase(s.codePointAt(0));
1.4m articles
1.4m replys
5 comments
57.0k users