18

In languages where the decimal separator is a ,(comma) the CSV (comma separated values file format) separator is a ; (semicolon). I know where to find this configuration in the Windows Control Panel, but I don't know how to find it progamatically in a .NET application.

I guess that Thread.CurrentThread.CurrentCulture has that information, but I couldn't find inside it.

Jader Dias
  • 88,211
  • 155
  • 421
  • 625

1 Answers1

44

System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator

Is the only way I know how.

jhunter
  • 1,852
  • 4
  • 26
  • 37
  • some time this doesn't work , even the separator is a comma (,), excel may still expect a semi column (;) to be separator – Benny Jul 07 '21 at 06:54