共用方式為


_Format.Format Method

Definition

Overloads

Format(Object)

Formats an object to produce a string.

Format(Object, StringBuffer, FieldPosition)

Formats an object and appends the resulting text to a given string buffer.

Format(Object)

Formats an object to produce a string.

[Android.Runtime.Register("format", "(Ljava/lang/Object;)Ljava/lang/String;", "")]
public string? Format (Java.Lang.Object? obj);
[<Android.Runtime.Register("format", "(Ljava/lang/Object;)Ljava/lang/String;", "")>]
member this.Format : Java.Lang.Object -> string

Parameters

obj
Object

The object to format

Returns

Formatted string.

Attributes

Exceptions

if the object cannot be formatted by this format.

Remarks

Formats an object to produce a string. This is equivalent to <blockquote> #format(Object, StringBuffer, FieldPosition) format(obj, new StringBuffer(), new FieldPosition(0)).toString();</blockquote>

Java documentation for java.text.Format.format(java.lang.Object).

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

Format(Object, StringBuffer, FieldPosition)

Formats an object and appends the resulting text to a given string buffer.

[Android.Runtime.Register("format", "(Ljava/lang/Object;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Ljava_lang_Object_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler")]
public abstract Java.Lang.StringBuffer? Format (Java.Lang.Object? obj, Java.Lang.StringBuffer? toAppendTo, Java.Text.FieldPosition? pos);
[<Android.Runtime.Register("format", "(Ljava/lang/Object;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Ljava_lang_Object_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler")>]
abstract member Format : Java.Lang.Object * Java.Lang.StringBuffer * Java.Text.FieldPosition -> Java.Lang.StringBuffer

Parameters

obj
Object

The object to format

toAppendTo
StringBuffer

where the text is to be appended

pos
FieldPosition

A FieldPosition identifying a field in the formatted text

Returns

the string buffer passed in as toAppendTo, with formatted text appended

Attributes

Exceptions

if the object cannot be formatted by this format.

Remarks

Formats an object and appends the resulting text to a given string buffer. If the pos argument identifies a field used by the format, then its indices are set to the beginning and end of the first such field encountered.

Java documentation for java.text.Format.format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition).

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