using System; using System.Linq; public class Test { public static void Main() { string str = "someId=00000-000-0000-000000;someotherId=123456789;someIdentifier=3030;"; var idLookup = str.Split(new[]{';'}, StringSplitOptions.RemoveEmptyEntries) .Select(token => new { keyvalues=token.Split(new[]{'='}, StringSplitOptions.RemoveEmptyEntries) }) .ToLookup(x => x.keyvalues.First(), x => x.keyvalues.Last()); // now you can lookup a key to get it's value similar to a Dictionary but with duplicates allowed string someotherId = idLookup["someotherId"].First(); Console.Write("someotherId: " + someotherId); } }