最佳答案
How can I delete the last two characters 05
of the simple string?
Simple:
"apple car 05"
Code
String[] lineSplitted = line.split(":");
String stopName = lineSplitted[0];
String stop = stopName.substring(0, stopName.length() - 1);
String stopEnd = stopName.substring(0, stop.length() - 1);
orginal line before splitting ":"
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