Share via


SimpleDateFormat.MatchQuarterString Method

Definition

Attempt to match the text at a given position against an array of quarter strings.

[Android.Runtime.Register("matchQuarterString", "(Ljava/lang/String;II[Ljava/lang/String;Landroid/icu/util/Calendar;)I", "GetMatchQuarterString_Ljava_lang_String_IIarrayLjava_lang_String_Landroid_icu_util_Calendar_Handler", ApiSince=24)]
protected virtual int MatchQuarterString (string? text, int start, int field, string[]? data, Android.Icu.Util.Calendar? cal);
[<Android.Runtime.Register("matchQuarterString", "(Ljava/lang/String;II[Ljava/lang/String;Landroid/icu/util/Calendar;)I", "GetMatchQuarterString_Ljava_lang_String_IIarrayLjava_lang_String_Landroid_icu_util_Calendar_Handler", ApiSince=24)>]
abstract member MatchQuarterString : string * int * int * string[] * Android.Icu.Util.Calendar -> int
override this.MatchQuarterString : string * int * int * string[] * Android.Icu.Util.Calendar -> int

Parameters

text
String

the time text being parsed.

start
Int32

where to start parsing.

field
Int32

the date field being parsed.

data
String[]

the string array to parsed.

cal
Calendar

Returns

the new start position if matching succeeded; a negative number indicating matching failure, otherwise. As a side effect, sets the cal field field to the index of the best match, if matching succeeded.

Attributes

Remarks

Attempt to match the text at a given position against an array of quarter strings. Since multiple strings in the array may match (for example, if the array contains "a", "ab", and "abc", all will match the input string "abcd") the longest match is returned. As a side effect, the given field of cal is set to the index of the best match, if there is one.

Java documentation for android.icu.text.SimpleDateFormat.matchQuarterString(java.lang.String, int, int, java.lang.String[], android.icu.util.Calendar).

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