MonthDay.Parse Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| Parse(String) |
Parses a month and day from a string without a year. |
| Parse(ICharSequence) |
Obtains an instance of MonthDay from a text string such as --12-03. |
| Parse(ICharSequence, DateTimeFormatter) |
Obtains an instance of MonthDay from a text string using a specific formatter. |
| Parse(String, DateTimeFormatter) |
Parses a month-day string with the specified formatter. |
Parse(String)
Parses a month and day from a string without a year.
public static Java.Time.MonthDay? Parse(string? text);
static member Parse : string -> Java.Time.MonthDay
Parameters
- text
- String
The month and day text, for example --12-03.
Returns
The month and day read from text.
Remarks
This string overload calls Parse(ICharSequence). Its default format has two hyphens, a two-digit month, a hyphen, and a two-digit day.
Applies to
Parse(ICharSequence)
Obtains an instance of MonthDay from a text string such as --12-03.
[Android.Runtime.Register("parse", "(Ljava/lang/CharSequence;)Ljava/time/MonthDay;", "", ApiSince=26)]
public static Java.Time.MonthDay? Parse(Java.Lang.ICharSequence? text);
[<Android.Runtime.Register("parse", "(Ljava/lang/CharSequence;)Ljava/time/MonthDay;", "", ApiSince=26)>]
static member Parse : Java.Lang.ICharSequence -> Java.Time.MonthDay
Parameters
- text
- ICharSequence
the text to parse such as "--12-03", not null
Returns
the parsed month-day, not null
- Attributes
Remarks
Obtains an instance of MonthDay from a text string such as --12-03. The string must represent a valid month-day. The format is --MM-dd.
Java reference for java.time.MonthDay.parse.
Applies to
Parse(ICharSequence, DateTimeFormatter)
Obtains an instance of MonthDay from a text string using a specific formatter.
[Android.Runtime.Register("parse", "(Ljava/lang/CharSequence;Ljava/time/format/DateTimeFormatter;)Ljava/time/MonthDay;", "", ApiSince=26)]
public static Java.Time.MonthDay? Parse(Java.Lang.ICharSequence? text, Java.Time.Format.DateTimeFormatter? formatter);
[<Android.Runtime.Register("parse", "(Ljava/lang/CharSequence;Ljava/time/format/DateTimeFormatter;)Ljava/time/MonthDay;", "", ApiSince=26)>]
static member Parse : Java.Lang.ICharSequence * Java.Time.Format.DateTimeFormatter -> Java.Time.MonthDay
Parameters
- text
- ICharSequence
the text to parse, not null
- formatter
- DateTimeFormatter
the formatter to use, not null
Returns
the parsed month-day, not null
- Attributes
Remarks
Obtains an instance of MonthDay from a text string using a specific formatter. The text is parsed using the formatter, returning a month-day.
Java reference for java.time.MonthDay.parse.
Applies to
Parse(String, DateTimeFormatter)
Parses a month-day string with the specified formatter.
public static Java.Time.MonthDay? Parse(string? text, Java.Time.Format.DateTimeFormatter? formatter);
static member Parse : string * Java.Time.Format.DateTimeFormatter -> Java.Time.MonthDay
Parameters
- text
- String
The string that contains the month and day fields.
- formatter
- DateTimeFormatter
The formatter that reads the month and day fields.
Returns
The month and day read from text.
Remarks
This string overload calls Parse(ICharSequence, DateTimeFormatter). The supplied formatter determines the input format.