【发布时间】:2015-08-22 20:29:51
【问题描述】:
如何删除简单字符串的最后两个字符05?
简单:
"apple car 05"
代码
String[] lineSplitted = line.split(":");
String stopName = lineSplitted[0];
String stop = stopName.substring(0, stopName.length() - 1);
String stopEnd = stopName.substring(0, stop.length() - 1);
分割前的原行“:”
apple car 04:48 05:18 05:46 06:16 06:46 07:16 07:46 16:46 17:16 17:46 18:16 18:46 19:16
【问题讨论】:
-
到目前为止你尝试了什么?
-
javadoc 中有什么内容吗?
-
我已经尝试了上面的代码,但我觉得它是错误的方式。
-
@FastSnail:我正在拆分以获取行首的单词。