using System;
using System.Linq;
public class Program
{
public static void Main()
string test = "How now brown cow!";
string test2 = string.Join(" ", test.Split(new char[0], StringSplitOptions.RemoveEmptyEntries).ToList().Select(x => x.Trim()));
Console.WriteLine(test2);
}
// source: https://stackoverflow.com/questions/3905180/how-to-trim-whitespace-between-characters#:~:text=How%20to%20remove%20whitespaces%20between,()%20results%20%22C%20Sharp%22%20.