Mono Class Library: System.Convert Overview | Members

System.Convert.ToByte Method

Converts a string to a byte . [Edit]

public static byte ToByte (string value, IFormatProvider provider)

Parameters

value
The string to be converted. The string is in the System.Globalization.NumberStyles.Integer style. [Edit]
provider
A IFormatProvider that supplies a System.Globalization.NumberFormatInfo containing culture-specific formatting information. [Edit]

Returns

value as a byte. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionvalue is a null reference. [Edit]
FormatExceptionvalue does not consist of an optional sign followed by one or more digits (zero through nine). [Edit]
OverflowExceptionThe numeric value of value is greater than byte.MaxValue or less than byte.MinValue. [Edit]

Remarks

This method parses value using the information in the System.Globalization.NumberFormatInfo instance supplied by provider. If provider is null or if a System.Globalization.NumberFormatInfo cannot be obtained from provider, the string is parsed using the formatting information of the current system culture. [Edit]

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0