In Java, how to find if first character in a string is upper case without regex

后端 未结 8 1627
广开言路
广开言路 2020-11-30 04:39

In Java, find if the first character in a string is upper case without using regular expressions.

8条回答
  •  迷失自我
    2020-11-30 05:03

    There is many ways to do that, but the simplest seems to be the following one:

    boolean isUpperCase = Character.isUpperCase("My String".charAt(0));
    

提交回复
热议问题