| sdpublic static string ToString(char); |
Converts a Char to a String. |
| public static string ToString(bool); |
Returns a String representing the specified number. |
| public static string ToString(ushort); |
Converts a UInt16 to a String. This method is not CLS-compliant. |
| public static string ToString(int); |
Converts an Int32 to a String. |
| public static string ToString(sbyte); |
Converts an SByte to a String. This method is not CLS-compliant. |
| public static string ToString(byte); |
Converts a Byte to a String. |
| public static string ToString(short); |
Converts an Int16 to a String. |
| public static string ToString(long); |
Converts an Int64 to a String. |
| public static string ToString(Decimal); |
Converts a Decimal to a String. |
| public static string ToString(DateTime); |
Converts a DateTime to a String. |
| public static string ToString(TimeSpan); |
Converts a TimeSpan to a String. |
| public static string ToString(float); |
Returns a String representing the specified number. |
| public static string ToString(ulong); |
Converts a UInt64 to a String. This method is not CLS-compliant. |
| public static string ToString(double); |
Converts a Double to a String. |
| public static string ToString(short, int); |
Converts a 16-bit signed integer to a string in a specified base. |
| public static string ToString(byte, int); |
Converts an 8-bit unsigned integer to a string in a specified base. |
| public static string ToString(long, int); |
Converts a 64-bit signed integer to a string using a specified base. |
| public static string ToString(int, int); |
Converts a 32-bit signed integer to a string using a specified base. |
Steve HarrowPosted Apr 13, 2007, 9:35 PM
I am trying to learn the Read and WriteLine methods using a simple console app. The Read is accepting an integer input of value 1. But when it writes to the console, it writes 49. I tried using the ToString because I thought the erroneous results were due to the lack of a conversion method between Read and WriteLine. however, the result was the same. Can you explain? Here is the code: int age = Console.Read(); string agestring = age.ToString(); Console.WriteLine("age = " + agestring);