Program.cs 207 B

123456
  1. using System.Text.RegularExpressions;
  2. string s = "Мама мыла раму. ";
  3. string pattern = @"\s+";
  4. string target = " ";
  5. Regex regex = new Regex(pattern);
  6. string result = regex.Replace(s, target);