Locale - how to get case-sensitive value?

306 Views Asked by At

I have code like this:

import java.util.Locale;
Locale locale = new Locale("en_US");

When I wrote:

System.out.println(locale.toString());

it returns

en_us

not

en_US

is any way to get case-sensitive value?

1

There are 1 best solutions below

1
On

Taken from Oracle: The language field is case insensitive, but Locale always canonicalizes to lower case.