I am currently fixing FxCop issues so I encountered issue where I have to provide cultureinfo when converting a string using ToString()
.
Currently in my code nothing we are passing as IFormatProvider so I have read some msdn articles saying that when you don't pass any value for cultureinfo it will assign a default value and when you specify CultureInfo as InvariantCulture it will be independent of any culture.
My question is, "Are default and CultureInfo.InvariantCulture one and the same? Can I replace all my code from default to InvariantCulture?"
Ex :
int st = 123;
String s = st.ToString(123); // this will be taken as default
String s = st.ToString(123, CultureInfo.InvariantCulture); // culture is specified externally
Are the second and third lines equivalent?
float st = 123.5f; String s1 = st.ToString( CultureInfo.GetCultureInfo("de-DE")); String s2 = st.ToString( CultureInfo.InvariantCulture);
– Bisectrix