Share via


PluralRules.Select Method

Definition

Overloads

Select(FormattedNumber)

Given a formatted number, returns the keyword of the first rule that applies to the number.

Select(FormattedNumberRange)

Given a formatted number range, returns the overall plural form of the range.

Select(Double)

Given a floating-point number, returns the keyword of the first rule that applies to the number.

Select(FormattedNumber)

Given a formatted number, returns the keyword of the first rule that applies to the number.

[Android.Runtime.Register("select", "(Landroid/icu/number/FormattedNumber;)Ljava/lang/String;", "GetSelect_Landroid_icu_number_FormattedNumber_Handler", ApiSince=31)]
public virtual string? Select (Android.Icu.Number.FormattedNumber? number);
[<Android.Runtime.Register("select", "(Landroid/icu/number/FormattedNumber;)Ljava/lang/String;", "GetSelect_Landroid_icu_number_FormattedNumber_Handler", ApiSince=31)>]
abstract member Select : Android.Icu.Number.FormattedNumber -> string
override this.Select : Android.Icu.Number.FormattedNumber -> string

Parameters

number
FormattedNumber

The number for which the rule has to be determined.

Returns

The keyword of the selected rule.

Attributes

Remarks

Given a formatted number, returns the keyword of the first rule that applies to the number.

A FormattedNumber allows you to specify an exponent or trailing zeros, which can affect the plural category. To get a FormattedNumber, see NumberFormatter.

Java documentation for android.icu.text.PluralRules.select(android.icu.number.FormattedNumber).

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

Select(FormattedNumberRange)

Given a formatted number range, returns the overall plural form of the range.

[Android.Runtime.Register("select", "(Landroid/icu/number/FormattedNumberRange;)Ljava/lang/String;", "GetSelect_Landroid_icu_number_FormattedNumberRange_Handler", ApiSince=33)]
public virtual string? Select (Android.Icu.Number.FormattedNumberRange? range);
[<Android.Runtime.Register("select", "(Landroid/icu/number/FormattedNumberRange;)Ljava/lang/String;", "GetSelect_Landroid_icu_number_FormattedNumberRange_Handler", ApiSince=33)>]
abstract member Select : Android.Icu.Number.FormattedNumberRange -> string
override this.Select : Android.Icu.Number.FormattedNumberRange -> string

Parameters

range
FormattedNumberRange

The number range onto which the rules will be applied.

Returns

The keyword of the selected rule.

Attributes

Remarks

Given a formatted number range, returns the overall plural form of the range. For example, "3-5" returns "other" in English.

To get a FormattedNumberRange, see android.icu.number.NumberRangeFormatter.

This method only works if PluralRules was created with a locale. If it was created from PluralRules.createRules(), or if it was deserialized, this method throws UnsupportedOperationException.

Java documentation for android.icu.text.PluralRules.select(android.icu.number.FormattedNumberRange).

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

Select(Double)

Given a floating-point number, returns the keyword of the first rule that applies to the number.

[Android.Runtime.Register("select", "(D)Ljava/lang/String;", "GetSelect_DHandler", ApiSince=24)]
public virtual string? Select (double number);
[<Android.Runtime.Register("select", "(D)Ljava/lang/String;", "GetSelect_DHandler", ApiSince=24)>]
abstract member Select : double -> string
override this.Select : double -> string

Parameters

number
Double

The number for which the rule has to be determined.

Returns

The keyword of the selected rule.

Attributes

Remarks

Given a floating-point number, returns the keyword of the first rule that applies to the number.

Java documentation for android.icu.text.PluralRules.select(double).

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