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)

Converts a String to an SByte in the specified style. The SByte type is not CLS compliant. The CLS-compliant alternative is Byte.

[C#]
public static sbyte Parse(
   string s,
   NumberStyles style
);
[C++]
public: static char Parse(
   String* s,
   NumberStyles style
);
[JScript]
public static function Parse(
   s : String,
   style : NumberStyles
) : 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.

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 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 SByte.Parse methods do not accept not a number (NaN), or positive or negative infinity.

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

See Also

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