Skip to content

Instantly share code, notes, and snippets.

@sklivvz
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sklivvz/69da82a6c52764d2c4fd to your computer and use it in GitHub Desktop.
Save sklivvz/69da82a6c52764d2c4fd to your computer and use it in GitHub Desktop.
void Main()
{
CultureInfo
.GetCultures(CultureTypes.AllCultures)
.Select(x =>
new string[]{x.IetfLanguageTag, x.EnglishName, x.NativeName,x.LCID.ToString()}
.Concat(z=>"<td>"+z+"</td>")
)
.Select(x => "<tr>"+x+"</tr>")
.Each(Console.WriteLine);
}
static class Extensions
{
public static void Each<T>(this IEnumerable<T> list, Action<T> action)
{
foreach(var v in list) action(v);
}
public static string Concat(this IEnumerable<string> list, Func<string, string> func)
{
var b = new StringBuilder();
list.Each(x=>b.Append(func(x)));
return b.ToString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment