Search code examples
asp.netcsvexportculture

Asp.net export to csv and culture


I'm exporting data to a csv file using Asp.net and I need to know from the System.Globalization.CultureInfo.CurrentCulture if I should use "," or ";" as a value separator. For example US needs "," and Europe needs ";". How can I find out which one to use from the CurrentCulture?

Thanks!


Solution

  • System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator
    

    Definition from the msdn docs:

    Gets or sets the string that separates items in a list.