refactored lastIndexOf

This commit is contained in:
Chumva 2018-03-05 15:35:52 +02:00
parent 5704196700
commit 2391ff613c

View file

@ -60,8 +60,9 @@ public class TransportStopRouteAdapter extends ArrayAdapter<TransportStopRoute>
private String getAdjustedRouteRef(String ref) {
if (ref != null) {
if (ref.contains(":")) {
ref = ref.substring(0, ref.lastIndexOf(':'));
int charPos=ref.lastIndexOf(':');
if (charPos!=-1) {
ref = ref.substring(0, charPos);
}
if (ref.length() > 4) {
ref = ref.substring(0, 4);