Udostępnij za pośrednictwem


_Format.ParseObject Method

Definition

Overloads

ParseObject(String)

Parses text from the beginning of the given string to produce an object.

ParseObject(String, ParsePosition)

Parses text from a string to produce an object.

ParseObject(String)

Parses text from the beginning of the given string to produce an object.

[Android.Runtime.Register("parseObject", "(Ljava/lang/String;)Ljava/lang/Object;", "GetParseObject_Ljava_lang_String_Handler")]
public virtual Java.Lang.Object? ParseObject (string? source);
[<Android.Runtime.Register("parseObject", "(Ljava/lang/String;)Ljava/lang/Object;", "GetParseObject_Ljava_lang_String_Handler")>]
abstract member ParseObject : string -> Java.Lang.Object
override this.ParseObject : string -> Java.Lang.Object

Parameters

source
String

A String whose beginning should be parsed.

Returns

An Object parsed from the string.

Attributes

Exceptions

if an error occurs during parsing.

Remarks

Parses text from the beginning of the given string to produce an object. The method may not use the entire text of the given string.

Java documentation for java.text.Format.parseObject(java.lang.String).

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

ParseObject(String, ParsePosition)

Parses text from a string to produce an object.

[Android.Runtime.Register("parseObject", "(Ljava/lang/String;Ljava/text/ParsePosition;)Ljava/lang/Object;", "GetParseObject_Ljava_lang_String_Ljava_text_ParsePosition_Handler")]
public abstract Java.Lang.Object? ParseObject (string? source, Java.Text.ParsePosition? pos);
[<Android.Runtime.Register("parseObject", "(Ljava/lang/String;Ljava/text/ParsePosition;)Ljava/lang/Object;", "GetParseObject_Ljava_lang_String_Ljava_text_ParsePosition_Handler")>]
abstract member ParseObject : string * Java.Text.ParsePosition -> Java.Lang.Object

Parameters

source
String

A String, part of which should be parsed.

pos
ParsePosition

A ParsePosition object with index and error index information as described above.

Returns

An Object parsed from the string. In case of error, returns null.

Attributes

Remarks

Parses text from a string to produce an object.

The method attempts to parse text starting at the index given by pos. If parsing succeeds, then the index of pos is updated to the index after the last character used (parsing does not necessarily use all characters up to the end of the string), and the parsed object is returned. The updated pos can be used to indicate the starting point for the next call to this method. If an error occurs, then the index of pos is not changed, the error index of pos is set to the index of the character where the error occurred, and null is returned.

Java documentation for java.text.Format.parseObject(java.lang.String, java.text.ParsePosition).

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