Converts a String to an 8-bit unsigned byte.
[Visual Basic] Overloads Public Shared Function ToByte( _ ByVal value As String _ ) As Byte [C#] public static byte ToByte( string value ); [C++] public: static unsigned char ToByte( String* value ); [JScript] public static function ToByte( value : String ) : Byte;
The converted value.
Exception Type | Condition |
---|---|
ArgumentNullException | If value is null. |
FormatException | If the value is not a string representation that can be converted to a Byte using the Parse(String) method implemented by that type. |
OverflowException | If the value represented by value is greater than Byte.MaxValue or less than Byte.MinValue. Note that if the beginning of the string value contains a properly formatted numerical value that will result in an overflow and, in addition, the end of the string is improperly formed, it cannot be determined whether an OverflowException or a FormatException will be thrown. This has been implemented this way for performance reasons. The implementation is provided by Byte.Parse(String). |
[To be supplied.]
Convert Class | Convert Members | System Namespace | Convert.ToByte Overload List