“跟踪信息纬度:3.9574667经度:7.448882167”
消息字符串的结构不会改变,只是数字会改变。
答案 0 :(得分:0)
为此,您甚至不需要正则表达式。只需拆分String并调用正确的索引:
String latLongString = "Tracking info Latitude: 3.9574667 Longitude: 7.44882167"; //yours obviously won't be hardcoded
String[] split = latLongString.split(" ");
String lat = split[3];
String lon = split[5];