System::Int32::TryParse 方法

Int32::TryParse(const String&, Globalization::NumberStyles, const SharedPtr<Globalization::CultureInfo>&, int32_t&) method

static bool System::Int32::TryParse(const String &value, Globalization::NumberStyles styles, const SharedPtr<Globalization::CultureInfo> &culture, int32_t &result)

另见

Int32::TryParse(const String&, Globalization::NumberStyles, const SharedPtr<Globalization::NumberFormatInfo>&, int32_t&) method

static bool System::Int32::TryParse(const String &value, Globalization::NumberStyles styles, const SharedPtr<Globalization::NumberFormatInfo> &nfi, int32_t &result)

另见

Int32::TryParse(const String&, Globalization::NumberStyles, const SharedPtr<IFormatProvider>&, int32_t&) method

使用提供的格式信息和数字样式,将包含数字字符串表示的指定字符串转换为等价的 32 位有符号整数。

static bool System::Int32::TryParse(const String &value, Globalization::NumberStyles styles, const SharedPtr<IFormatProvider> &provider, int32_t &result)
ParameterType描述
valueconst String&要转换的字符串。
样式Globalization::NumberStylesNumberStyles 枚举值的按位组合,指定数字字符串表示的允许样式。
提供程序const SharedPtr<IFormatProvider>&指向包含字符串格式信息的对象的指针。
结果int32_t&用于存放转换结果的 32 位有符号整数变量的引用。

ReturnValue

如果转换成功则为 true,否则为 false。

另见

Int32::TryParse(const String&, Globalization::NumberStyles, std::nullptr_t, int32_t&) method

static bool System::Int32::TryParse(const String &value, Globalization::NumberStyles styles, std::nullptr_t, int32_t &result)

另见

Int32::TryParse(const String&, int32_t&) method

将包含数字字符串表示的指定字符串转换为等价的 32 位有符号整数。

static bool System::Int32::TryParse(const String &value, int32_t &result)
ParameterType描述
valueconst String&要转换的字符串。
结果int32_t&用于存放转换结果的 32 位有符号整数变量的引用。

ReturnValue

如果转换成功则为 true,否则为 false。

另见