Good day.
I am trying to replace a text character from a file with another character
Here is the code:
string s = TextMP1.text;
var word = " ";
var replaceTo = "- ";
var words = new Regex(word).Matches(s).OfType<Match>().Select(match => match.Index).ToList();
var result = s.Substring(0, words[0]) + replaceTo + s.Substring(words[0] + word.Length);
Nothing works, what should I do?