using System;
using System.Text.RegularExpressions;
public class Program
{
public static void Main()
var mySentence = "The cat sat on the mat, chair, bed, table";
Console.WriteLine(Regex.Replace(mySentence,"(, )(\\S+)$", " and $2"));
}