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.FromString

Converts a String to an unsigned byte.

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

Parameters

s
The string that contains a number to convert.

Return Value

The Byte value of the string.

Exceptions

Exception Type Condition
ArgumentNullException If the string is null.
FormatException If the string does not contain a well-formed number.
OverflowException If the string is less than 0 or greater than 255.

Remarks

The default (locale-neutral) of NumberFormatInfo is used. Use Parse and Format for locale-dependent strings. (In addition information on cultures and locale-neutral, see CultureInfo.)

The output from ToString should be consumable by FromString. Use Parse() and Format() for locale dependent strings.

See Also

Byte Structure | Byte Members | System Namespace