System.Convert.ToString Method

Converts the value of an 8-bit unsigned integer to its equivalent string representation in a specified base.

Syntax

public static string ToString (byte value, int toBase)

Parameters

value
The 8-bit unsigned integer to convert.
toBase
The base of the return value, which must be 2, 8, 10, or 16.

Returns

The string representation of value in base toBase.

Remarks

If toBase does not equal 10, the string that is returned by the Convert.ToString(byte, int) method represents value by its magnitude only. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a magnitude-only numeric representation should be called to perform the conversion. Such methods include Convert.ToByte(string, int) or byte.Parse(string, System.Globalization.NumberStyles).

Requirements

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