我正在使用String的split方法,想要获取最后一个元素。数组的大小可能会改变。
示例:
String one = "Düsseldorf - Zentrum - Günnewig Uebachs"
String two = "Düsseldorf - Madison"
我想要分割以上字符串并获取最后一项:lastone = one.split("-")[here the last item] // <- how?
lasttwo = two.split("-")[here the last item] // <- how?
我不知道运行时数组的大小 :(