Freigeben über


MessageFormat.SetFormats(_Format[]) Method

Definition

Sets the formats to use for the format elements in the previously set pattern string.

[Android.Runtime.Register("setFormats", "([Ljava/text/Format;)V", "GetSetFormats_arrayLjava_text_Format_Handler")]
public virtual void SetFormats (Java.Text._Format[]? newFormats);
[<Android.Runtime.Register("setFormats", "([Ljava/text/Format;)V", "GetSetFormats_arrayLjava_text_Format_Handler")>]
abstract member SetFormats : Java.Text._Format[] -> unit
override this.SetFormats : Java.Text._Format[] -> unit

Parameters

newFormats
_Format[]

the new formats to use

Attributes

Remarks

Sets the formats to use for the format elements in the previously set pattern string. The order of formats in newFormats corresponds to the order of format elements in the pattern string.

If more formats are provided than needed by the pattern string, the remaining ones are ignored. If fewer formats are provided than needed, then only the first newFormats.length formats are replaced.

Since the order of format elements in a pattern string often changes during localization, it is generally better to use the #setFormatsByArgumentIndex setFormatsByArgumentIndex method, which assumes an order of formats corresponding to the order of elements in the arguments array passed to the format methods or the result array returned by the parse methods.

Java documentation for java.text.MessageFormat.setFormats(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