01 比较字符串末端是否相同
- 字符串转字符数组并通过遍历后几位来比较是否相同
- 根据比较字符串长度截取被比较字符串再通过
str.equals(ending)
比较得出是否相等 - 直接通过
str.endsWith(ending)
得出是否相等
str.equals(ending)
比较得出是否相等str.endsWith(ending)
得出是否相等上一篇:简述Java特性和优势
下一篇:Java 面试必备(字符串专题)
codewars
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M