String类的判断功能

A:String类的判断功能

    * boolean equals(Object obj):比较字符串的内容是否相同,区分大小写

    * boolean equalsIgnoreCase(String str):比较字符串的内容是否相同,忽略大小写

    * boolean contains(String str):判断大字符串中是否包含小字符串

    * boolean startsWith(String str):判断字符串是否以某个指定的字符串开头

    * boolean endsWith(String str):判断字符串是否以某个指定的字符串结尾

    * boolean isEmpty():判断字符串是否为空。

猜你喜欢

转载自blog.csdn.net/Cricket_7/article/details/88768215