I have the following string as input :
\"2.0,3.00,-4.0,0.00,-0.00,0.03,2.01,0.001,-0.03,101\"
Final output will be like :
You can do it with 2 times replacement :
first use \.0+(?=(,|$)) and replace with ""
\.0+(?=(,|$))
""
then use (?!(^|,))-0(?=(,|$)) and replace it with "0"
(?!(^|,))-0(?=(,|$))
"0"