Assuming I have understood the required result, I tried a C# approach.
String str = "1 2 3 4 5 6 7 8 9";
Console.WriteLine("Original string: \"{0}\"", str);
Console.WriteLine("CSV string: \"{0}\"", str.Replace(' ', ','));
var chars = new List<char>();
chars.AddRange(str);
chars.RemoveAt(3);
chars.RemoveAt(4);
var result = String.Join("", chars);
Console.WriteLine("New CSV string: \"{0}\"", result.Replace(' ', ','));
Console.ReadKey();
This converts the string to a list, removes the spaces at position 3 & 5, and converts the list back to a string.
The output:
New CSV string: "1,234,5,6,7,8,9"