In C#, I am using
CultureInfo.GetCultureInfo(myCulture)
but the string variable may not come in a good format, is there a way to try parse the string first or verify it first.
The following yields a collection of all cultures:
CultureInfo.GetCultures(CultureTypes.AllCultures)
From there, rather than GetCultureInfo
you could do:
.FirstOrDefault(c => c.Name == myCulture)
Rather than AllCultures
you may want to filter out SpecificCultures
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With