Reputation: 3
I have a string like:
st = 0,090,000,170,16-0,030,19 0,330,19
How to add a spaces into it, two positions after each comma, to get string like:
st = 0,09 0,00 0,17 0,16 -0,03 0,19 0,33 0,19
Upvotes: 0
Views: 239
Reputation: 1685
Using Regex.Replace like below
var oldString = "0,090,000,170,16 - 0,030,19 0,330,19";
var newString = Regex.Replace(oldString, ",[0-9]{2}", (match) => { return match.Value + " "; });
Upvotes: 3