Click or drag to resize
ConvertToByte Method (String)
Converts the specified string representation of a number to an equivalent 8-bit unsigned integer.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static byte ToByte(
	string value
)

Parameters

value
Type: SystemString
A string that contains the number to convert.

Return Value

Type: Byte
An 8-bit unsigned integer that is equivalent to value, or zero if value is null.
Exceptions
ExceptionCondition
FormatExceptionvalue does not consist of an optional sign followed by a sequence of digits (0 through 9).
OverflowExceptionvalue represents a number that is less than MinValue or greater than MaxValue.
See Also