我有一个kml文件的lat和long字符串,我想在下面的字符串中更改所有经度值为负值。
我认为最简单的方法是将它们放入三元组并迭代每一行并在第一个数字上添加一个负号。
latlong = "1.48638,54.9621256516623,0 1.48521523184216,54.9621324923351,0 1.48405081848398,54.9621530122697,0 1.48288711461705,54.9621872052157,0 1.48172447471685,54.9622350607575"
latlong = Replace(latlong, " ", vbCrLf)
这
1.48638,54.9621256516623,0
1.48521523184216,54.9621324923351,0
.....
到
-1.48521523184216,54.9621324923351,0
-1.48405081848398,54.9621530122697,0
非常感谢你的帮助。
答案 0 :(得分:2)
试试这个
latlong = "-" & latlong
latlong = Replace(latlong, " ", vbCrLf & "-")