"Dogs Cats Birds Snakes"
string input = "Dogs Cats Birds"
string pattern = "\\s+";
string replacement = ",";
Regex rgx = new Regex(pattern);
string result = rgx.Replace(input, replacement)
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)