Mono Class Library: System.SByte Overview | Members

System.SByte.Parse Method

Returns the specified String converted to a sbyte value. [Edit]

[System.CLSCompliant(false)]
public static sbyte 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. [Edit]
provider
A IFormatProvider that supplies a System.Globalization.NumberFormatInfo containing culture-specific formatting information about s. [Edit]

Returns

The sbyte value obtained from s. [Edit]

Exceptions

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

Remarks

This version of sbyte.Parse(string) is equivalent to sbyte.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.

This method is not CLS-compliant. For a CLS-compliant alternative use short.Parse(string) (string, IFormatProvider).

[Edit]

Requirements

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