语言

MonthDay.Parse 方法

定义

重载

名称 说明
Parse(String)

从字符串中分析一个月和一天,而不用一年。

Parse(ICharSequence)

从文本字符串(如 --12-03)获取 MonthDay 的实例。

Parse(ICharSequence, DateTimeFormatter)

使用特定格式化程序从文本字符串中获取 MonthDay 的实例。

Parse(String, DateTimeFormatter)

使用指定的格式化程序分析一个月天字符串。

Parse(String)

从字符串中分析一个月和一天,而不用一年。

public static Java.Time.MonthDay? Parse(string? text);
static member Parse : string -> Java.Time.MonthDay

参数

text
String

例如, --12-03月和日文本。

返回

从中读取 text的月份和日期。

注解

此字符串重载调用 Parse(ICharSequence)。 其默认格式有两个连字符,一个两位数的月份、一个连字符和一个两位数的日期。

适用于

Parse(ICharSequence)

从文本字符串(如 --12-03)获取 MonthDay 的实例。

[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

参数

text
ICharSequence

要分析的文本,例如“--12-03”,而不是 null

返回

分析的月-天,而不是 null

特性

注解

从文本字符串(如 --12-03)获取 MonthDay 的实例。 该字符串必须表示有效的月天。 格式为 --MM-dd。

Java参考java.time.MonthDay.parse。

适用于

Parse(ICharSequence, DateTimeFormatter)

使用特定格式化程序从文本字符串中获取 MonthDay 的实例。

[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

参数

text
ICharSequence

要分析的文本,而不是 null

formatter
DateTimeFormatter

要使用的格式化程序,而不是 null

返回

分析的月-天,而不是 null

特性

注解

使用特定格式化程序从文本字符串中获取 MonthDay 的实例。 使用格式化程序分析文本,并返回一个月。

Java参考java.time.MonthDay.parse。

适用于

Parse(String, DateTimeFormatter)

使用指定的格式化程序分析一个月天字符串。

public static Java.Time.MonthDay? Parse(string? text, Java.Time.Format.DateTimeFormatter? formatter);
static member Parse : string * Java.Time.Format.DateTimeFormatter -> Java.Time.MonthDay

参数

text
String

包含月份和日期字段的字符串。

formatter
DateTimeFormatter

读取月份和日期字段的格式化程序。

返回

从中读取 text的月份和日期。

注解

此字符串重载调用 Parse(ICharSequence, DateTimeFormatter)。 提供的格式化程序确定输入格式。

适用于