What is the C# equivalent of Java's Locale.ROOT and Locale.getDefault()?

前端 未结 1 1261
迷失自我
迷失自我 2021-01-19 04:24

When converting Java to C#, what is the proper way to translate Locale to CultureInfo?

I know in C# we have CultureInfo.CurrentCulture for the current t

1条回答
  •  甜味超标
    2021-01-19 04:52

    Well, thanks to Andreas, I can surmize from the javadoc:

    Locale.ROOT (Java) == CultureInfo.InvariantCulture (C#)
    

    And

    Locale.getDefault() (Java) == CultureInfo.CurrentCulture (C#)
    

    I just wish that document was easier to find! I had Googled things like java locale.root equivalent c# and java locale.getdefault equivalent c# with no useful results.

    0 讨论(0)
提交回复
热议问题