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;
The Byte value of the string.
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. |
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.