dropEncodingPart

Drop encoding part from locale (it's not used in constructing localized keys).

@safe pure nothrow
String
dropEncodingPart
(
String
)
(
String locale
)
if (
isSomeString!String &&
is(ElementEncodingType!String : char)
)

Return Value

Type: String

Locale string with encoding part dropped out or original string if encoding was not present.

Examples

assert("ru_RU.UTF-8".dropEncodingPart() == "ru_RU");
string locale = "ru_RU";
assert(locale.dropEncodingPart() is locale);

Meta