在Java中我们有indexOf和lastIndexOf.有什么相似的lastSubstring吗?它应该像:
"aaple".lastSubstring(0, 1) = "e";
Run Code Online (Sandbox Code Playgroud)
lah*_*her 11
不在标准Java API中,但是......
Apache Commons在StringUtils中有很多方便的String辅助方法
...包括StringUtils.right("apple",1)
只需从commons.apache.org获取commons-lang.jar的副本
| 归档时间: |
|
| 查看次数: |
26367 次 |
| 最近记录: |