Text editing small program
The program should return edit text, where you have to replace" - ", ": ", "; ", ", ", " " with "\t".
The problem here is the result
Input: Китай: 1405023000; 24.08.2020; 17.99%
Expected Китай 1405023000 24.08.2020 17.99%
Myne Китай: 1405023000; 24.08.2020; 17.99%
So for some reason, I believe he messing with the order of stringSeparators elements or what. I am interested in this moment
public static string ReplaceIncorrectSeparators(string text)
{
string populationEdited = "";
string[] stringSeparators = new string[] {" - ", ": ", "; ", ", ", " "};
for (int i = 0; i < stringSeparators.Length; i++)
{
populationEdited = text.Replace(stringSeparators[i], "\t");
}
return populationEdited;
}
I've already solved the problem in another way but I want to solve it with separators.