티스토리 뷰

공부

[java] string to locale

승가비 2023. 10. 7. 13:40
728x90
org.apache.commons.lang3.LocaleUtils.toLocale("en_US")

Locale.forLanguageTag("en-US")

https://stackoverflow.com/questions/2522248/how-to-get-locale-from-its-string-representation-in-java

 

How to get Locale from its String representation in Java?

Is there a neat way of getting a Locale instance from its "programmatic name" as returned by Locale's toString() method? An obvious and ugly solution would be parsing the String and then constructi...

stackoverflow.com

 

728x90

'공부' 카테고리의 다른 글

[sh] args  (0) 2023.10.12
[sh] hostname -I (IP 확인)  (0) 2023.10.12
[java] linux centos install jdk  (0) 2023.10.07
[slack] incoming webhook  (0) 2023.10.05
[spring] @VisibleForTesting  (1) 2023.10.05
댓글