1

I am currently using toLanguageTag() to get locale code but it gives the locale code which contains dash - , my requirement is to basically return the same data but it should contain underscore _, is there a way we can achieve it without using toString() methods and string replacement?

this document says use toString() for debugging purpose.

Hulk
  • 6,399
  • 1
  • 30
  • 52
skr
  • 1,700
  • 1
  • 15
  • 39
  • Related: https://stackoverflow.com/questions/4904803/en-us-or-en-us-which-one-should-you-use – Hulk Jul 16 '20 at 07:43
  • 1
    Related: https://softwareengineering.stackexchange.com/questions/325458/parse-both-en-us-and-en-us-as-locale-in-java – Hulk Jul 16 '20 at 07:53
  • This is far more complicated than it might seem at first (this is often the case when dealing with internationalization). The correct answer probably depends on what you need these locale ids for – Hulk Jul 16 '20 at 08:01

0 Answers0