I am trying to get a string, for example, "e1e2e3" to have each digit replaced with a different character, which in this case would be a random number. Whereas instead of e1e2e3, it could be something like e5e9e1 because each number is replaced with a random one.
I tried
string txt = textBox1.Text;
Regex digits = new Regex(@"\d", RegexOptions.None);
Random rand = new Random();
txt = digits.Replace(txt, rand.Next(0, 9).ToString());
MessageBox.Show(txt);
The problem is, every single number is replaced with the same random number. "e1e2e3" would then be something like "e2e2e2" where each number is the same.