i'm parsing out Long values from given String-s.
Long.valueOf()
and Long.parseLong()
wouldn't work - because such a String str
is in the format 1,234,567 and can be surrounded by spaces.
I can work this by processing the String to get it to bare digits-- then parsing the value out. so - it would be something like
str.trim();
String tempArray [] = str.split(",");
str = "";
for (String s:tempArray)
str+=s;
however, there must be a better way of doing this. What is it?