-1

I'm having WF application and trying to serialize/deserialize its data based on different cases (like in CurrentCulture and InvariantCulture).

I'm facing problem when change the CurrentCulture.TextInfo.ListSeparator before serialization / deserialization.

Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US", false); Thread.CurrentThread.CurrentUICulture.TextInfo.ListSeparator = ";";

To resolve the problems, i need to find whether ListSeparator has modified or not. I could not find any method for this.

Please suggest me your ideas.

Thanks.

Prithiv
  • 504
  • 5
  • 20
  • 2
    That is arguably the wrong solution to the problem. Rather than trying to figure out if anything is different, write things so they don't break if they are -- either by being explicit about the `CultureInfo` to use, or by using its properties to figure out the right values to use. What meaningful thing would you intend to do if you *did* discover a difference? – Jeroen Mostert Feb 04 '20 at 11:46

1 Answers1

0

used below code to identify whether ListSeparator is modified or not. if(CultureInfo.CurrentCulture.TextInfo.ListSeparator != CultureInfo.GetCultureInfo(CultureInfo.CurrentCulture.Name).TextInfo.ListSeparator){}

Prithiv
  • 504
  • 5
  • 20
  • You know that you're comparing a `CultureInfo` with itself, right? Btw1, see also `Thread.CurrentThread.CurrentCulture` and `Thread.CurrentThread.CurrentUICulture`. Btw2, you didn't specify what concrete problem you're trying to solve. – Jimi Feb 04 '20 at 13:09