如何在String内部拆分double double

时间:2017-04-06 04:52:23

标签: java android type-conversion

我希望获得Google地图的两倍。 "lonLat": "-128.1048,51.083",

String lonlat = location.getLonLat();
Double d = Double.parseDouble(lonlat);
.position(new LatLng(double, double)) // Google Map

1 个答案:

答案 0 :(得分:1)

试试这个

String CurrentString = "-128.1048,51.083",
String[] separated = CurrentString.split(",");
separated[0]; // 
separated[1];