机智奇异果

文章
10
资源
0
加入时间
3年1月29天

【Java源码分析】String 方法 endsWith

endsWith()endsWith() 方法用于测试字符串是否以指定的后缀结束。语法public boolean endsWith(String suffix)参数suffix – 指定的后缀。返回值如果参数表示的字符序列是此对象表示的字符序列的后缀,则返回 true;否则返回 false。注意,如果参数是空字符串,或者等于此 String 对象(用 equals(Object) 方法确定),则结果为 true。实例public class Test { public st