Replace(str, " $1"); C# code example
Example: String.Replace() c#
String s = "aaa";
Console.WriteLine($"The initial string: {s}");
s = s.Replace("a", "b").Replace("b", "c").Replace("c", "d");
Console.WriteLine($"Final String: {s}");
// Returns "Final String: ddd"