using System.Text.RegularExpressions;
public static void Main()
var sentence = "This sentence contains both lowercase and uppercase English letter , puctuation marks,and spaces.";
var pattern1 = new Regex(@"\s+(?=[.,?!])");
var outcome1 = pattern1.Replace(sentence, String.Empty);
var pattern2 = new Regex(@"\p{P}(?! |$)");
var outcome2 = pattern2.Replace(outcome1, "$0 ");
var final = outcome2.Substring(0, outcome2.Length-0) + "";
Console.WriteLine(final);