Language

Locale.Builder.SetExtension(Char, String) Method

Definition

Sets the extension for the given key.

[Android.Runtime.Register("setExtension", "(CLjava/lang/String;)Ljava/util/Locale$Builder;", "")]
public Java.Util.Locale.Builder SetExtension(char key, string? value);
[<Android.Runtime.Register("setExtension", "(CLjava/lang/String;)Ljava/util/Locale$Builder;", "")>]
member this.SetExtension : char * string -> Java.Util.Locale.Builder

Parameters

key
Char

the extension key

value
String

the extension value

Returns

This builder.

Attributes

Remarks

Sets the extension for the given key. A null or empty value requests removal. On Android 5 and 6, removal matches the key with its original case; on Android 7 through 17, it is case-insensitive. A non-empty value is checked for valid syntax. The key UNICODE_LOCALE_EXTENSION ('u') is used for the Unicode locale extension. On Android 7 through 17, setting this key replaces existing Unicode locale keywords and attributes; a null or empty value clears them. On Android 5 and 6, a null or empty value does not clear those keywords or attributes. A non-empty value clears other extensions and the Unicode attributes, sets the parsed keywords, and retains existing keywords not in the new value. The key PRIVATE_USE_EXTENSION ('x') is used for the private use code. To be well-formed, the value for this key needs only to have subtags of one to eight alphanumeric characters, not two to eight as in the general case.

Java reference for java.util.Locale.Builder.setExtension.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to