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

后端 未结 8 1643
广开言路
广开言路 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 04:55

    If you have to check it out manually you can do int a = s.charAt(0)

    If the value of a is between 65 to 90 it is upper case.

提交回复
热议问题