string a = "1,2,3,4"; string b = "5,6,7,8"; string[] arra = a.Split(','); string[] arrb = b.Split(','); string c = ""; for (int i = 0; i < arra.Length; i++) { c += arra[i] + "-" + arrb[i] + ","; } Console.WriteLine(c.TrimEnd(','));