// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace E { public class Program { public static void Main(string[] args) { string s = "hej,hej|hej2,hej2|803,lol"; string[] parts = s.Split('|'); string[] array1 = Array.ConvertAll(parts, e => e.Split(',')[0]); string[] array2 = Array.ConvertAll(parts, e => e.Split(',')[1]); for(int i = 0; i < parts.Length; i++) { Console.WriteLine(array1[i] + " " + array2[i]); } } } }