Skip to content

Instantly share code, notes, and snippets.

@ah01
Last active January 29, 2020 23:14
Show Gist options
  • Save ah01/f6e2586290d78a722fdbe7fc3c836565 to your computer and use it in GitHub Desktop.
Save ah01/f6e2586290d78a722fdbe7fc3c836565 to your computer and use it in GitHub Desktop.
List Separators in Different Cultures (separator for CSV in Excel)
using System.Globalization;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
foreach (var c in cultures)
{
var same = c.Parent == CultureInfo.InvariantCulture ? "" : (c.Parent.TextInfo.ListSeparator == c.TextInfo.ListSeparator ? "Yes" : "No");
System.Console.WriteLine($"{c.Name}\t{c.TwoLetterISOLanguageName}\t{c.EnglishName}\t{c.TextInfo.ListSeparator}\t{same}\n");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment