C# UInt32 ToString(String)
Description
UInt32 ToString(String)
converts the numeric value
of this instance to its equivalent string representation using the specified
format.
Syntax
UInt32.ToString(String)
has the following syntax.
public string ToString(
string format
)
Parameters
UInt32.ToString(String)
has the following parameters.
format
- A numeric format string.
Returns
UInt32.ToString(String)
method returns The string representation of the value of this instance as specified by format.
Example
The following example displays a 32-bit unsigned integer value by using each standard format string and some custom format strings.
//from ww w . j av a2 s .c o m
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
uint value = 1234567;
string[] specifiers = { "G", "C", "D3", "E2", "e3", "F",
"N", "P", "X", "000000.0", "#.0",
"00000000;(0);**Zero**" };
foreach (string specifier in specifiers)
Console.WriteLine("{0}: {1}", specifier, value.ToString(specifier));
}
}
The code above generates the following result.