TryParse()

UInt16::TryParse(const String&, uint16_t&) method

Converts the specified string containing the string representation of a number to the equivalent 16-bit unsigned integer.

static bool System::UInt16::TryParse(const String &value, uint16_t &result)

Arguments

ParameterTypeDescription
valueconst String&The string to convert.
resultuint16_t&The reference to a 16-bit unsigned integer variable where the result of the conversion is put.

Return Value

True if the conversion succeeded, otherwise - false.

UInt16::TryParse(const String&, Globalization::NumberStyles, const SharedPtr<IFormatProvider>&, uint16_t&) method

Converts the specified string containing the string representation of a number to the equivalent 16-bit unsigned integer using the provided formatting information and number style.

static bool System::UInt16::TryParse(const String &value, Globalization::NumberStyles styles, const SharedPtr<IFormatProvider> &provider, uint16_t &result)

Arguments

ParameterTypeDescription
valueconst String&The string to convert.
stylesGlobalization::NumberStylesA bitwise combination of values of NumberStyles enum that specifies the permitted style of the string representation of a number.
providerconst SharedPtr<IFormatProvider>&A pointer to an object that contains the string format information.
resultuint16_t&The reference to a 16-bit unsigned integer variable where the result of the conversion is put.

Return Value

True if the conversion succeeded, otherwise - false.

UInt16::TryParse(const String&, Globalization::NumberStyles, const SharedPtr<Globalization::CultureInfo>&, uint16_t&) method

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

UInt16::TryParse(const String&, Globalization::NumberStyles, const SharedPtr<Globalization::NumberFormatInfo>&, uint16_t&) method

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

UInt16::TryParse(const String&, Globalization::NumberStyles, std::nullptr_t, uint16_t&) method

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

See Also