IParsable<TSelf>.TryParse(String, IFormatProvider, TSelf) 方法

定义

尝试将字符串分析为值。

public:
 static bool TryParse(System::String ^ s, IFormatProvider ^ provider, [Runtime::InteropServices::Out] TSelf % result);
public static bool TryParse (string? s, IFormatProvider? provider, out TSelf result);
static member TryParse : string * IFormatProvider * 'Self -> bool
Public Shared Function TryParse (s As String, provider As IFormatProvider, ByRef result As TSelf) As Boolean

参数

s
String

要分析的字符串。

provider
IFormatProvider

一个对象,提供有关 s 的区域性特定格式设置信息。

result
TSelf

此方法返回时,包含成功分析 s 或失败时未定义值的结果。

返回

Boolean

true 如果 s 已成功分析,则为 ;否则为 false

适用于