How to read "List Separator" settings from Regional configuration of control panel?
Try using System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator
or System.Globalization.CultureInfo.GetCultureInfo("en-US").TextInfo.ListSeparator
if you look for a specific culture's information.
Related videos on Youtube
shahjapan
Passion: Computer Science, Programming, R & D, Troubleshooting Programming: Python, C#, Shell scripting Frontend Technologies: Bootstrap, Javascript, JQuery, SCSS Cloud Technologies: GCP, AWS Virtualisation: Docker, Docker-Compose, k8s RDBMS: MySQL, PostgreSQL, SQLite Operating Systems: Linux, Windows, OSX Testing: Unit Tests, pytest, Jenkins, selenium Hobbies: Playing Chess, Swimming & roaming -- Japan Shah
Updated on July 27, 2020Comments
-
shahjapan almost 4 years
I'm making multi culture plugin for MS Word,Excel where I need to identify setting value provided in Regional Settings under "List Separator" Option, how can I read using C# ?
This List separator is later on being used to construct Excel formulas, word mail merge header, etc.
-
Jeff Caron about 11 yearsJust as a side note if you plan to use CurrentCulture: make sure there is no code that change the Thread Culture.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("fr-CA");
msdn.microsoft.com/en-us/library/… -
Alex Mazzariol over 10 yearsIf someone changes the current culture of the thread it's usually to make the new settings effect things like these (exports, format). That's why there are two current cultures: one for the thread and one for the UI (CurrentUICulture). Just make sure you are using the one you need, and don't worry if someone changes it.
-
Oskar Berggren almost 9 yearsTo clarify @AlexMazzariol comment, which seems to imply that threads only have one culture: Threads have both CurrentCulture and CurrentUICulture. CurrentCulture determines formatting rules for dates, numbers, etc., while CurrentUICulture determines the language used.