I am parsing numerical data and sometimes I get negative numbers and when nothing is available I get --
I created a class to clean the numbers and passed them through a command:
output = output.replaceAll("\\-", " ");
I thought it was working fine because the double dashs were gone but now I realized all my negative numbers appear to be positive. I’m not sure how to approach it, is there a way to specifically say if two dashes exist after each other to replace it? or is there a way to accept a dash only if its followed by a number?
please help.
Thanks!
Can you just replace the “–” so negative numbers will not get affected ?
or just