I have the following:
string text = "version=\"1,0\"";
I want to replace commawith dot, keeping 1 and 0, BUT bearing in mind that they are different in different situations! It could be version="2,3".
Smart ass and noob-unworking way to do this:
for (int i = 0; i <= 9; i++)
{
for (int z = 0; z <= 9; z++)
{
text = Regex.Replace(text, "version=\"i,z\"", "version=\"i.z\"");
}
}
But, of course, is a string, and I do not want to i, and zacted like a line there.
I could also try the lame one, but work:
text = Regex.Replace(text, "version=\"1,", "version=\"1.");
text = Regex.Replace(text, "version=\"2,", "version=\"2.");
text = Regex.Replace(text, "version=\"3,", "version=\"3.");
And so on .. but that would be lame.
Any tips on how to deal with this alone?
Edit: I have other commas that I don't want to replace, so text.Replace(",",".")I cannot do