Jon*_*eet 48
就像是:
text = text.startsWith(",") ? text.substring(1) : text;
Run Code Online (Sandbox Code Playgroud)
非常简单......
Kep*_*pil 17
我会使用^锚点replaceFirst():
niceString = yourString.replaceFirst("^,", "");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
25579 次 |
| 最近记录: |