Share via


MessageFormat.SetFormat(Int32, _Format) Method

Definition

Sets the format to use for the format element with the given format element index within the previously set pattern string.

[Android.Runtime.Register("setFormat", "(ILjava/text/Format;)V", "GetSetFormat_ILjava_text_Format_Handler")]
public virtual void SetFormat (int formatElementIndex, Java.Text._Format? newFormat);
[<Android.Runtime.Register("setFormat", "(ILjava/text/Format;)V", "GetSetFormat_ILjava_text_Format_Handler")>]
abstract member SetFormat : int * Java.Text._Format -> unit
override this.SetFormat : int * Java.Text._Format -> unit

Parameters

formatElementIndex
Int32

the index of a format element within the pattern

newFormat
_Format

the format to use for the specified format element

Attributes

Remarks

Sets the format to use for the format element with the given format element index within the previously set pattern string. The format element index is the zero-based number of the format element counting from the start of the pattern string.

Since the order of format elements in a pattern string often changes during localization, it is generally better to use the #setFormatByArgumentIndex setFormatByArgumentIndex method, which accesses format elements based on the argument index they specify.

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