Assuming s
is non-empty:
Character.isUpperCase(s.charAt(0))
or, as mentioned by divec, to make it work for characters with code points above U+FFFF
:
Character.isUpperCase(s.codePointAt(0));
More Related Contents:
- incompatible types required char found java.lang.string
- Can I product of charAt in Java? [duplicate]
- How to replace a char with a string
- String index out of range in jva
- Why is char[] preferred over String for passwords?
- How to convert Strings to and from UTF8 byte arrays in Java
- Check string for palindrome
- How to convert a char to a String?
- How to convert a char array back to a string?
- How can non-ASCII characters be removed from a string?
- Putting char into a java string for each N characters
- Fastest way to iterate over all the chars in a String
- Isn’t the size of character in Java 2 bytes?
- How to check if a String contains only ASCII?
- How to convert/parse from String to char in java?
- Difference between “char” and “String” in Java
- The concatenation of chars to form a string gives different results
- Display special characters using System.out.println
- What is the character encoding of String in Java?
- How do I convert a byte array with null terminating character to a String in Java?
- How do I check if a char is a vowel?
- How do I apply the for-each loop to every character in a String?
- Java: Converting String to and from ByteBuffer and associated problems
- Illegal Escape Character “\”
- How to correctly compute the length of a String in Java?
- How to parse a mathematical expression given as a string and return a number? [duplicate]
- How to split a string in Java
- Java string intern and literal
- Java split String performances
- Java Encode file to Base64 string To match with other encoded string