Mono Class Library: System.Int16 Overview | Members

System.Int16.Parse Method

Returns the specified string converted to a shortvalue.

public static short Parse (string s, IFormatProvider provider)

Parameters

s
A string containing the value to convert. The string is interpreted using the System.Globalization.NumberStyles.Integer style.
provider
Documentation for this section has not yet been entered.
s
Documentation for this section has not yet been entered.

Returns

The short value obtained from s.

Exceptions

TypeReason
ArgumentNullExceptions is a null reference.
FormatExceptions is not in the correct style.
OverflowExceptions represents a number greater than short.MaxValue or less than short.MinValue.

Remarks

This version of short.Parse(string) is equivalent to short.Parse(string)(s, System.Globalization.NumberStyles.Integer, provider).

The string s is parsed using the culture-specific formatting information from the System.Globalization.NumberFormatInfo instance supplied by provider. If provider is null or a System.Globalization.NumberFormatInfo cannot be obtained from provider, the formatting information for the current system culture is used.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0