Last active
August 29, 2015 14:10
-
-
Save sklivvz/69da82a6c52764d2c4fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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