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!

Byte.Parse (String, NumberStyles)

Converts a String to a Byte with a specified style.

[Visual Basic]
Overloads Public Shared Function Parse( _
   ByVal s As String, _
   ByVal style As NumberStyles _
) As Byte
[C#]
public static byte Parse(
   string s,
   NumberStyles style
);
[C++]
public: static unsigned char Parse(
   String* s,
   NumberStyles style
);
[JScript]
public static function Parse(
   s : String,
   style : NumberStyles
) : Byte;

Parameters

s
The String to be interpreted.
style
The permitted style of the numeric string.

Return Value

A Byte with the value represented by s.

Exceptions

Exception Type Condition
ArgumentException If the style is not a valid combination of bit flags from the NumberStyles enumeration.
ArgumentNullException If the string is null.
FormatException If the string is not of the correct format.
FormatException If the string represents a number that is less than MinValue or greater than MaxValue.

Remarks

The numeric format information is obtained from the current locale. (For additional information about current locale or cultures, see CultureInfo.)

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

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

The style parameter must be a combination of bit flags from the NumberStyles Enumeration, except for NumberStyles.All and NumberStyles.AllowDecimalPoint, which are not valid values for this argument.

See Also

Byte Structure | Byte Members | System Namespace | Byte.Parse Overload List