Wednesday 15 June 2011

java - How to safely remove the commas on an ArrayList? -



java - How to safely remove the commas on an ArrayList? -

i have arraylist place float values.

xevent.add(filetimestamp); xevent.add(x); xevent.add(zcsv + "\n"); string formatedstring = xevent.tostring() .replace("[", "") // remove right bracket .replace("]", "") // remove left bracket

the problem arraylist places comma separate values. how can rid of comma without getting rid of comma in locales used decimal mark? on u.s. utilize period decimal mark, removing commas work, on countries utilize comma decimal mark end ruining data.

i'm not sure can errase ',' string without ruining data, recomend using for() info

string formatedstring=""; for(string s: xevent){ formatedstring += s; }

like info within string without ']','[' or ','. hope helps you.

java android regex

No comments:

Post a Comment