C# Convert ToString(Boolean, IFormatProvider)
Description
Convert ToString(Boolean, IFormatProvider)
converts
the specified Boolean value to its equivalent string representation.
Syntax
Convert.ToString(Boolean, IFormatProvider)
has the following syntax.
public static string ToString(
bool value,
IFormatProvider provider
)
Parameters
Convert.ToString(Boolean, IFormatProvider)
has the following parameters.
value
- The Boolean value to convert.provider
- An instance of an object. This parameter is ignored.
Returns
Convert.ToString(Boolean, IFormatProvider)
method returns The string representation of value.
Example
using System;// w ww. j a v a2 s. c o m
using System.Globalization;
class MainClass
{
public static void Main( )
{
NumberFormatInfo provider = new NumberFormatInfo();
provider.NegativeSign = "neg ";
provider.PositiveSign = "pos ";
provider.NumberDecimalSeparator = ".";
provider.NumberGroupSeparator = ",";
provider.NumberGroupSizes = new int[ ] { 3 };
provider.NumberNegativePattern = 0;
Console.WriteLine( Convert.ToString( true ));
Console.WriteLine( Convert.ToString( true, provider ) );
}
}
The code above generates the following result.