語言

MessageFormat.SetFormatByArgumentName(String, _Format) 方法

定義

<strong>[icu]</strong> 將 Format 物件設定為先前設定的模式字串中使用該參數名稱的格式元素。

[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

參數

argumentName
String

變更論點的名稱

newFormat
_Format

新格式

屬性

備註

<strong>[icu]</strong> 將 Format 物件設定為先前設定的模式字串中使用該參數名稱的格式元素。

如果參數名稱用於模式字串中的多個格式元素,則所有此類格式元素都會使用新的格式。 如果參數名稱未用於模式字串中的任何格式元素,則新格式將被忽略。

此 API 可用於不使用命名參數的格式。 此時 argumentName 應為一個字串,用來命名參數索引,例如 “0”、“1”、“2”...等等。若未標示有效索引,格式將被忽略。 不會擲回錯誤。

Java 文件 android.icu.text.MessageFormat.setFormatByArgumentName(java.lang.String, java.text.Format)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於