Class LocaleUtils


  • public class LocaleUtils
    extends Object
    Utilities for for dealing with Locale objects
    • Constructor Detail

      • LocaleUtils

        public LocaleUtils()
    • Method Detail

      • parse

        public static Locale parse​(String localeStr)
        Parse the given locale as language, language-country or language-country-variant. Either underscores or hyphens may be used as separators, but consistently, ie. you may not use an hyphen to separate the language from the country and an underscore to separate the country from the variant.
        Throws:
        IllegalArgumentException - if there are too many parts in the locale string
        IllegalArgumentException - if the language or country is not recognized