C# UInt32 ToString(IFormatProvider)

Description

UInt32 ToString(IFormatProvider) converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.

Syntax

UInt32.ToString(IFormatProvider) has the following syntax.


public string ToString(
  IFormatProvider provider
)

Parameters

UInt32.ToString(IFormatProvider) has the following parameters.

  • provider - An object that supplies culture-specific formatting information.

Returns

UInt32.ToString(IFormatProvider) method returns The string representation of the value of this instance, which consists of a sequence of digits ranging from 0 to 9, without a sign or leading zeros.

Example

The following example formats a 16-bit signed integer value by using several format providers, including one for the invariant culture.


/*from w  w  w.  j a  v a2  s .  c o m*/
using System;
using System.Globalization;

public class Example
{
   public static void Main()
   {
      // Define an array of CultureInfo objects.
      CultureInfo[] ci = { new CultureInfo("en-US"), 
                           new CultureInfo("fr-FR"), 
                           CultureInfo.InvariantCulture }; 
      uint value = 123123123;
      Console.WriteLine(value.ToString(ci[0]));
      Console.WriteLine(value.ToString(ci[1]));
      Console.WriteLine(value.ToString(ci[2]));   
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version