ToString() default CultureInfo

mishap picture mishap · Apr 4, 2013 · Viewed 11.1k times · Source

I think I understand the CultureInfo usage.

If I do simple :

const int a = 5;
string b = a.ToString();

is it equal to :

const int a = 5;
string b = a.ToString(CultureInfo.InvariantCulture);

In other words, does ToString() by default use InvariantCulture or CurrentCulture or neither ?

Answer

Oded picture Oded · Apr 4, 2013

ToString will use CurrentCulture, not InvariantCulture if you do not specify a culture.