Partager via


SimpleDateFormat.SubParse Method

Definition

Protected method that converts one field of the input string into a numeric field value in cal.

[Android.Runtime.Register("subParse", "(Ljava/lang/String;ICIZZ[ZLandroid/icu/util/Calendar;)I", "GetSubParse_Ljava_lang_String_ICIZZarrayZLandroid_icu_util_Calendar_Handler", ApiSince=24)]
protected virtual int SubParse (string? text, int start, char ch, int count, bool obeyCount, bool allowNegative, bool[]? ambiguousYear, Android.Icu.Util.Calendar? cal);
[<Android.Runtime.Register("subParse", "(Ljava/lang/String;ICIZZ[ZLandroid/icu/util/Calendar;)I", "GetSubParse_Ljava_lang_String_ICIZZarrayZLandroid_icu_util_Calendar_Handler", ApiSince=24)>]
abstract member SubParse : string * int * char * int * bool * bool * bool[] * Android.Icu.Util.Calendar -> int
override this.SubParse : string * int * char * int * bool * bool * bool[] * Android.Icu.Util.Calendar -> int

Parameters

text
String

the time text to be parsed.

start
Int32

where to start parsing.

ch
Char

the pattern character for the date field text to be parsed.

count
Int32

the count of a pattern character.

obeyCount
Boolean

if true, then the next field directly abuts this one, and we should use the count to know when to stop parsing.

allowNegative
Boolean
ambiguousYear
Boolean[]

return parameter; upon return, if ambiguousYear[0] is true, then a two-digit year was parsed and may need to be readjusted.

cal
Calendar

cal

Returns

the new start position if matching succeeded; a negative number indicating matching failure, otherwise. As a side effect, set the appropriate field of cal with the parsed value.

Attributes

Remarks

Protected method that converts one field of the input string into a numeric field value in cal. Returns -start (for ParsePosition) if failed. Subclasses may override this method to modify or add parsing capabilities.

Java documentation for android.icu.text.SimpleDateFormat.subParse(java.lang.String, int, char, int, boolean, boolean, boolean[], 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