I want to split this string
String info = "0.542008835 meters height from ground";
from this i want to get only two decimals like this 0.54
.
by using this i am getting that
String[] _new = rhs.split("(?<=\\G....)");
But i am facing problem here, if string does't contain any decimals like this string
String info = "1 meters height from ground";
for this string i am getting those characters upto first 4 in the split string like 1 me
.
i want only numbers to split if it has decimals, How to solve this problem.