Mono Class Library: System.Xml.XmlConvert Overview | Members

System.Xml.XmlConvert.ToByte Method

Converts a string to a byte equivalent.

public static byte ToByte (string s)

Parameters

s
The string to convert.

Returns

The byte equivalent of s.

Exceptions

TypeReason
ArgumentNullExceptions is a null reference.
FormatExceptions is not in the correct format.
OverflowExceptions represents a number less than byte.MinValue or greater than byte.MaxValue.

Remarks

This method calls byte.Parse(string)(s, System.Globalization.NumberStyles.AllowLeadingWhite|System.Globalization.NumberStyles.AllowTrailingWhite, System.Globalization.NumberFormatInfo.InvariantInfo).

Requirements

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