Returns a String representation of a specified number in a specified counting system (base).
[Visual Basic] Public Shared Function ToString( _ ByVal value As Long, _ ByVal radix As Integer _ ) As String [C#] public static string ToString( long value, int radix ); [C++] public: static String* ToString( __int64 value, int radix ); [JScript] public static function ToString( value : long, radix : int ) : String;
For base 10, no prefix is printed. For base 16, "0x" is prefixed to the number, for base 8, a "0" is prefixed to the number. For all other bases "nn#" is prefixed to the number (where nn is the two digit base). The rest of the String returned is made up of characters representing the magnitude. The following characters are used in the representation: 0123456789abcdefghijklmnopqrstuvwxyz (note that uppercase characters are NOT returned). If the radix is N, the first N characters in the listing just mentioned may be used in the representation. For negative values, the negative is carried over into the string, except for base 16 and 8, which have well defined rules for dealing with negative values.
Value | Radix | String |
---|---|---|
10 | 12 | "12#a" |
-10 | 16 | "0xfffffffffffffff6" |
-10 | 9 | "-09#11" |
16 | 16 | "0x10" |
-2 | 8 | "01777777777777777777776" |