public static void Main()
Console.WriteLine(FormatTitle("abc, def,efd,dfd, sdfs"));
private static string FormatTitle(string title)
string[] titleList = Array.ConvertAll(title.Split(','), p => p.Trim());
return String.Join(", ", titleList.ToArray(), 0, titleList.Length - 1) + (titleList.LastOrDefault().Trim()!=""? " and " + titleList.LastOrDefault():"");