String para KeyValuePair usando LINQ

CSharp · Console

/Program.cs

using System;
using System.Linq;
using System.Collections.Generic;

public class Program
{
	public static void Main()
	{
		var texto = "N1N2S3S4L5L6O7O8X"; 
		var keys = texto.Zip(texto.Skip(1), (Key, Value) => new	{Key, Value}).
			Where((pair, index) => index % 2 == 0)
			.Select(k => new KeyValuePair<string, string>(k.Key.ToString(), k.Value.ToString())); 
		
		foreach (var item in keys)
			Console.WriteLine(@"{{{0},{1}}}",item.Key,item.Value);}
}
;