다음을 통해 공유


MessageFormat.SetFormatByArgumentName(String, _Format) Method

Definition

<strong>[icu]</strong> Sets the Format object to use for the format elements within the previously set pattern string that use the given argument name.

[Android.Runtime.Register("setFormatByArgumentName", "(Ljava/lang/String;Ljava/text/Format;)V", "GetSetFormatByArgumentName_Ljava_lang_String_Ljava_text_Format_Handler", ApiSince=24)]
public virtual void SetFormatByArgumentName (string? argumentName, Java.Text._Format? newFormat);
[<Android.Runtime.Register("setFormatByArgumentName", "(Ljava/lang/String;Ljava/text/Format;)V", "GetSetFormatByArgumentName_Ljava_lang_String_Ljava_text_Format_Handler", ApiSince=24)>]
abstract member SetFormatByArgumentName : string * Java.Text._Format -> unit
override this.SetFormatByArgumentName : string * Java.Text._Format -> unit

Parameters

argumentName
String

the name of the argument to change

newFormat
_Format

the new format to use

Attributes

Remarks

<strong>[icu]</strong> Sets the Format object to use for the format elements within the previously set pattern string that use the given argument name.

If the argument name is used for more than one format element in the pattern string, then the new format is used for all such format elements. If the argument name is not used for any format element in the pattern string, then the new format is ignored.

This API may be used on formats that do not use named arguments. In this case argumentName should be a String that names an argument index, e.g. "0", "1", "2"... etc. If it does not name a valid index, the format will be ignored. No error is thrown.

Java documentation for android.icu.text.MessageFormat.setFormatByArgumentName(java.lang.String, java.text.Format).

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