I am having a string of this type :
String price="$34.56 - $98.45" or it can be simply "$34.56"
I want to convert this string to 34.56-98.45 and 34.56 respectively.
Whats best and easiest way to do it in Java . I was trying for some regex but could not come up.