NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

SByte.Parse (String, NumberStyles, NumberFormatInfo)

This method converts a String to an SByte in the style specified by NumberFormatInfo. The SByte type is not CLS compliant. The CLS-compliant alternative is Byte.

[C#]
public static sbyte Parse(
   string s,
   NumberStyles style,
   NumberFormatInfo info
);
[C++]
public: static char Parse(
   String* s,
   NumberStyles style,
   NumberFormatInfo* info
);
[JScript]
public static function Parse(
   s : String,
   style : NumberStyles,
   info : NumberFormatInfo
) : SByte;

[Visual Basic] The SByte type cannot be used in Visual Basic.

Parameters [C#, C++, JScript]

s
The string to be interpreted.
style
The permitted style of the numeric string.
info
The NumberFormatInfo instance used to format the string.

Return Value [C#, C++, JScript]

Returns an SByte with the value represented by s.

Exceptions [C#, C++, JScript]

Exception Type Condition
ArgumentNullException If s is a null reference (in Visual Basic Nothing).
ArgumentException If style is not a combination of bit flags from the NumberStyles enumeration.
FormatException If s is not of the correct format.
OverflowException If s represents a number that is less than SByte.MinValue or greater than SByte.MaxValue.

Remarks [C#, C++, JScript]

The style parameter must be a combination of bit flags from the NumberStyles enumeration.

If the info parameter is null the numeric format information is obtained from the current locale (see NumberFormatInfo and CultureInfo for number and culture specific formatting).

If s has been created by one of the Format methods using C, D, E, F, G, or N as the format specifier, it is guaranteed that s can be parsed when style is NumberStyles enumeration.

Note   The Parse methods do not accept not a number (NaN), or positive or negative infinity.

See Also

SByte Structure | SByte Members | System Namespace | SByte.Parse Overload List | String | NumberFormatInfo | NaN | NaN | PositiveInfinity | PositiveInfinity | NegativeInfinity | NegativeInfinity