XmlConvert.ToString XmlConvert.ToString XmlConvert.ToString XmlConvert.ToString Method

Definition

Converts strongly typed data to an equivalent String representation.

Overloads

ToString(Single) ToString(Single) ToString(Single) ToString(Single)

Converts the Single to a String.

ToString(TimeSpan) ToString(TimeSpan) ToString(TimeSpan) ToString(TimeSpan)

Converts the TimeSpan to a String.

ToString(UInt16) ToString(UInt16) ToString(UInt16) ToString(UInt16)

Converts the UInt16 to a String.

ToString(UInt32) ToString(UInt32) ToString(UInt32) ToString(UInt32)

Converts the UInt32 to a String.

ToString(DateTimeOffset, String) ToString(DateTimeOffset, String) ToString(DateTimeOffset, String) ToString(DateTimeOffset, String)

Converts the supplied DateTimeOffset to a String in the specified format.

ToString(DateTime, String) ToString(DateTime, String) ToString(DateTime, String) ToString(DateTime, String)

Converts the DateTime to a String.

ToString(DateTime, XmlDateTimeSerializationMode) ToString(DateTime, XmlDateTimeSerializationMode) ToString(DateTime, XmlDateTimeSerializationMode) ToString(DateTime, XmlDateTimeSerializationMode)

Converts the DateTime to a String using the XmlDateTimeSerializationMode specified.

ToString(SByte) ToString(SByte) ToString(SByte) ToString(SByte)

Converts the SByte to a String.

ToString(UInt64) ToString(UInt64) ToString(UInt64) ToString(UInt64)

Converts the UInt64 to a String.

ToString(Int64) ToString(Int64) ToString(Int64) ToString(Int64)

Converts the Int64 to a String.

ToString(Boolean) ToString(Boolean) ToString(Boolean) ToString(Boolean)

Converts the Boolean to a String.

ToString(Int16) ToString(Int16) ToString(Int16) ToString(Int16)

Converts the Int16 to a String.

ToString(Guid) ToString(Guid) ToString(Guid) ToString(Guid)

Converts the Guid to a String.

ToString(Double) ToString(Double) ToString(Double) ToString(Double)

Converts the Double to a String.

ToString(Decimal) ToString(Decimal) ToString(Decimal) ToString(Decimal)

Converts the Decimal to a String.

ToString(DateTimeOffset) ToString(DateTimeOffset) ToString(DateTimeOffset) ToString(DateTimeOffset)

Converts the supplied DateTimeOffset to a String.

ToString(DateTime) ToString(DateTime) ToString(DateTime) ToString(DateTime)

Converts the DateTime to a String.

ToString(Char) ToString(Char) ToString(Char) ToString(Char)

Converts the Char to a String.

ToString(Byte) ToString(Byte) ToString(Byte) ToString(Byte)

Converts the Byte to a String.

ToString(Int32) ToString(Int32) ToString(Int32) ToString(Int32)

Converts the Int32 to a String.

ToString(Single) ToString(Single) ToString(Single) ToString(Single)

Converts the Single to a String.

public:
 static System::String ^ ToString(float value);
public static string ToString (float value);
static member ToString : single -> string
Public Shared Function ToString (value As Single) As String

Parameters

value
Single Single Single Single

The value to convert.

Returns

A string representation of the Single.

Remarks

If value is Single.PositiveInfinity or Single.NegativeInfinity, this method returns the string INF or -INF respectively.

See also

ToString(TimeSpan) ToString(TimeSpan) ToString(TimeSpan) ToString(TimeSpan)

Converts the TimeSpan to a String.

public:
 static System::String ^ ToString(TimeSpan value);
public static string ToString (TimeSpan value);
static member ToString : TimeSpan -> string
Public Shared Function ToString (value As TimeSpan) As String

Parameters

value
TimeSpan TimeSpan TimeSpan TimeSpan

The value to convert.

Returns

A string representation of the TimeSpan.

ToString(UInt16) ToString(UInt16) ToString(UInt16) ToString(UInt16)

Important

This API is not CLS-compliant.

Converts the UInt16 to a String.

public:
 static System::String ^ ToString(System::UInt16 value);
[System.CLSCompliant(false)]
public static string ToString (ushort value);
static member ToString : uint16 -> string
Public Shared Function ToString (value As UShort) As String

Parameters

value
UInt16 UInt16 UInt16 UInt16

The value to convert.

Returns

A string representation of the UInt16.

ToString(UInt32) ToString(UInt32) ToString(UInt32) ToString(UInt32)

Important

This API is not CLS-compliant.

Converts the UInt32 to a String.

public:
 static System::String ^ ToString(System::UInt32 value);
[System.CLSCompliant(false)]
public static string ToString (uint value);
static member ToString : uint32 -> string
Public Shared Function ToString (value As UInteger) As String

Parameters

value
UInt32 UInt32 UInt32 UInt32

The value to convert.

Returns

A string representation of the UInt32.

ToString(DateTimeOffset, String) ToString(DateTimeOffset, String) ToString(DateTimeOffset, String) ToString(DateTimeOffset, String)

Converts the supplied DateTimeOffset to a String in the specified format.

public:
 static System::String ^ ToString(DateTimeOffset value, System::String ^ format);
public static string ToString (DateTimeOffset value, string format);
static member ToString : DateTimeOffset * string -> string
Public Shared Function ToString (value As DateTimeOffset, format As String) As String

Parameters

format
String String String String

The format to which s is converted. The format parameter can be any subset of the W3C Recommendation for the XML dateTime type. (For more information, see the dateTime section of the XML Schema specification..)

Returns

A String representation in the specified format of the supplied DateTimeOffset.

Examples

The following example converts a DateTimeOffset representation of the current time to a String in the specified format.

using System;
using System.Xml;

class Example
{
    static void Main()
    {
        // Create the DateTimeOffset object and set the time to the current time.
        DateTimeOffset dto;
        dto = DateTimeOffset.Now;

        // Convert the DateTimeObject to a string in a specified format and display the result.
        // The specified format must be a subset of the W3C Recommendation for the XML dateTime type.
        String timeAsString = XmlConvert.ToString(dto, "yyyy-MM-ddTHH:mm:sszzzzzzz");
        Console.WriteLine(timeAsString);
    }
}
Imports System.Xml

Module Module1
    Sub Main()

        ' Create the DateTimeOffset object and set the time to the current time.
        Dim dto As DateTimeOffset
        dto = DateTimeOffset.Now

        ' Convert the DateTimeObject to a string in a specified format and display the result.
        ' The specified format must be a subset of the W3C Recommendation for the XML dateTime type.
        Dim timeAsString As [String] = XmlConvert.ToString(dto, "yyyy-MM-ddTHH:mm:sszzzzzzz")
        Console.WriteLine(timeAsString)

    End Sub
End Module

ToString(DateTime, String) ToString(DateTime, String) ToString(DateTime, String) ToString(DateTime, String)

Converts the DateTime to a String.

public:
 static System::String ^ ToString(DateTime value, System::String ^ format);
public static string ToString (DateTime value, string format);
static member ToString : DateTime * string -> string
Public Shared Function ToString (value As DateTime, format As String) As String

Parameters

value
DateTime DateTime DateTime DateTime

The value to convert.

format
String String String String

The format structure that defines how to display the converted string. Valid formats include "yyyy-MM-ddTHH:mm:sszzzzzz" and its subsets.

Returns

A string representation of the DateTime in the specified format.

Examples

The following example, converts data types to string and then writes the information out to the console.

#using <System.Xml.dll>

using namespace System;
using namespace System::IO;
using namespace System::Xml;
int main()
{
   
   //Define the order data.  They will be converted to string 
   //before being written out.
   Int16 custID = 32632;
   String^ orderID = "367A54";
   DateTime orderDate = DateTime::Now;
   Double price = 19.95;
   
   //Create a writer that outputs to the console.
   XmlTextWriter^ writer = gcnew XmlTextWriter( Console::Out );
   writer->Formatting = Formatting::Indented;
   
   //Write an element (this one is the root)
   writer->WriteStartElement( "order" );
   
   //Write the order date.
   writer->WriteAttributeString( "date", XmlConvert::ToString( orderDate, "yyyy-MM-dd" ) );
   
   //Write the order time.
   writer->WriteAttributeString( "time", XmlConvert::ToString( orderDate, "HH:mm:ss" ) );
   
   //Write the order data.
   writer->WriteElementString( "orderID", orderID );
   writer->WriteElementString( "custID", XmlConvert::ToString( custID ) );
   writer->WriteElementString( "price", XmlConvert::ToString( price ) );
   
   //Write the close tag for the root element
   writer->WriteEndElement();
   
   //Write the XML and close the writer
   writer->Close();
}

using System;
using System.IO;
using System.Xml;

public class Sample
{
  public static void Main()
  {

    //Define the order data.  They will be converted to string 
    //before being written out.
    Int16 custID = 32632;
    String orderID = "367A54";
    DateTime orderDate = new DateTime();
    orderDate = DateTime.Now;
    Double price = 19.95;

    //Create a writer that outputs to the console.
    XmlTextWriter writer = new XmlTextWriter (Console.Out);
    writer.Formatting = Formatting.Indented;

    //Write an element (this one is the root)
    writer.WriteStartElement("order");

    //Write the order date.
    writer.WriteAttributeString("date", XmlConvert.ToString(orderDate, "yyyy-MM-dd"));

    //Write the order time.
    writer.WriteAttributeString("time", XmlConvert.ToString(orderDate, "HH:mm:ss"));
    
    //Write the order data.
    writer.WriteElementString("orderID", orderID);
    writer.WriteElementString("custID", XmlConvert.ToString(custID));
    writer.WriteElementString("price", XmlConvert.ToString(price));

    //Write the close tag for the root element
    writer.WriteEndElement();
             
    //Write the XML and close the writer
    writer.Close();  

  }

}
Imports System.IO
Imports System.Xml

public class Sample

  public shared sub Main()

    'Define the order data.  They will be converted to string
    'before being written out.
    Dim custID as Int16 = 32632
    Dim orderID as String = "367A54"
    Dim orderDate as DateTime 
    orderDate = DateTime.Now
    Dim price as Double = 19.95

    'Create a writer that outputs to the console.
    Dim writer as XmlTextWriter = new XmlTextWriter (Console.Out)
    'Use indenting for readability
    writer.Formatting = Formatting.Indented
    
    'Write an element (this one is the root)
    writer.WriteStartElement("order")

    'Write the order date.
    writer.WriteAttributeString("date", XmlConvert.ToString(orderDate, "yyyy-MM-dd"))

    'Write the order time.
    writer.WriteAttributeString("time", XmlConvert.ToString(orderDate, "HH:mm:ss"))
    
    'Write the order data.
    writer.WriteElementString("orderID", orderID)
    writer.WriteElementString("custID", XmlConvert.ToString(custID))
    writer.WriteElementString("price", XmlConvert.ToString(price))

    'Write the close tag for the root element
    writer.WriteEndElement()
             

    'Write the XML and close the writer
    writer.Flush()
    writer.Close()  

  end sub
end class

ToString(DateTime, XmlDateTimeSerializationMode) ToString(DateTime, XmlDateTimeSerializationMode) ToString(DateTime, XmlDateTimeSerializationMode) ToString(DateTime, XmlDateTimeSerializationMode)

Converts the DateTime to a String using the XmlDateTimeSerializationMode specified.

public:
 static System::String ^ ToString(DateTime value, System::Xml::XmlDateTimeSerializationMode dateTimeOption);
public static string ToString (DateTime value, System.Xml.XmlDateTimeSerializationMode dateTimeOption);
static member ToString : DateTime * System.Xml.XmlDateTimeSerializationMode -> string
Public Shared Function ToString (value As DateTime, dateTimeOption As XmlDateTimeSerializationMode) As String

Parameters

value
DateTime DateTime DateTime DateTime

The DateTime value to convert.

Returns

A String equivalent of the DateTime.

Exceptions

ToString(SByte) ToString(SByte) ToString(SByte) ToString(SByte)

Important

This API is not CLS-compliant.

Converts the SByte to a String.

public:
 static System::String ^ ToString(System::SByte value);
[System.CLSCompliant(false)]
public static string ToString (sbyte value);
static member ToString : sbyte -> string
Public Shared Function ToString (value As SByte) As String

Parameters

value
SByte SByte SByte SByte

The value to convert.

Returns

A string representation of the SByte.

ToString(UInt64) ToString(UInt64) ToString(UInt64) ToString(UInt64)

Important

This API is not CLS-compliant.

Converts the UInt64 to a String.

public:
 static System::String ^ ToString(System::UInt64 value);
[System.CLSCompliant(false)]
public static string ToString (ulong value);
static member ToString : uint64 -> string
Public Shared Function ToString (value As ULong) As String

Parameters

value
UInt64 UInt64 UInt64 UInt64

The value to convert.

Returns

A string representation of the UInt64.

ToString(Int64) ToString(Int64) ToString(Int64) ToString(Int64)

Converts the Int64 to a String.

public:
 static System::String ^ ToString(long value);
public static string ToString (long value);
static member ToString : int64 -> string
Public Shared Function ToString (value As Long) As String

Parameters

value
Int64 Int64 Int64 Int64

The value to convert.

Returns

A string representation of the Int64.

ToString(Boolean) ToString(Boolean) ToString(Boolean) ToString(Boolean)

Converts the Boolean to a String.

public:
 static System::String ^ ToString(bool value);
public static string ToString (bool value);
static member ToString : bool -> string
Public Shared Function ToString (value As Boolean) As String

Parameters

value
Boolean Boolean Boolean Boolean

The value to convert.

Returns

A string representation of the Boolean, that is, "true" or "false".

ToString(Int16) ToString(Int16) ToString(Int16) ToString(Int16)

Converts the Int16 to a String.

public:
 static System::String ^ ToString(short value);
public static string ToString (short value);
static member ToString : int16 -> string
Public Shared Function ToString (value As Short) As String

Parameters

value
Int16 Int16 Int16 Int16

The value to convert.

Returns

A string representation of the Int16.

Examples

The following example, converts data types to string and then writes the information out to the console.

#using <System.Xml.dll>

using namespace System;
using namespace System::IO;
using namespace System::Xml;
int main()
{
   
   //Define the order data.  They will be converted to string 
   //before being written out.
   Int16 custID = 32632;
   String^ orderID = "367A54";
   DateTime orderDate = DateTime::Now;
   Double price = 19.95;
   
   //Create a writer that outputs to the console.
   XmlTextWriter^ writer = gcnew XmlTextWriter( Console::Out );
   writer->Formatting = Formatting::Indented;
   
   //Write an element (this one is the root)
   writer->WriteStartElement( "order" );
   
   //Write the order date.
   writer->WriteAttributeString( "date", XmlConvert::ToString( orderDate, "yyyy-MM-dd" ) );
   
   //Write the order time.
   writer->WriteAttributeString( "time", XmlConvert::ToString( orderDate, "HH:mm:ss" ) );
   
   //Write the order data.
   writer->WriteElementString( "orderID", orderID );
   writer->WriteElementString( "custID", XmlConvert::ToString( custID ) );
   writer->WriteElementString( "price", XmlConvert::ToString( price ) );
   
   //Write the close tag for the root element
   writer->WriteEndElement();
   
   //Write the XML and close the writer
   writer->Close();
}

using System;
using System.IO;
using System.Xml;

public class Sample
{
  public static void Main()
  {

    //Define the order data.  They will be converted to string 
    //before being written out.
    Int16 custID = 32632;
    String orderID = "367A54";
    DateTime orderDate = new DateTime();
    orderDate = DateTime.Now;
    Double price = 19.95;

    //Create a writer that outputs to the console.
    XmlTextWriter writer = new XmlTextWriter (Console.Out);
    writer.Formatting = Formatting.Indented;

    //Write an element (this one is the root)
    writer.WriteStartElement("order");

    //Write the order date.
    writer.WriteAttributeString("date", XmlConvert.ToString(orderDate, "yyyy-MM-dd"));

    //Write the order time.
    writer.WriteAttributeString("time", XmlConvert.ToString(orderDate, "HH:mm:ss"));
    
    //Write the order data.
    writer.WriteElementString("orderID", orderID);
    writer.WriteElementString("custID", XmlConvert.ToString(custID));
    writer.WriteElementString("price", XmlConvert.ToString(price));

    //Write the close tag for the root element
    writer.WriteEndElement();
             
    //Write the XML and close the writer
    writer.Close();  

  }

}
Imports System.IO
Imports System.Xml

public class Sample

  public shared sub Main()

    'Define the order data.  They will be converted to string
    'before being written out.
    Dim custID as Int16 = 32632
    Dim orderID as String = "367A54"
    Dim orderDate as DateTime 
    orderDate = DateTime.Now
    Dim price as Double = 19.95

    'Create a writer that outputs to the console.
    Dim writer as XmlTextWriter = new XmlTextWriter (Console.Out)
    'Use indenting for readability
    writer.Formatting = Formatting.Indented
    
    'Write an element (this one is the root)
    writer.WriteStartElement("order")

    'Write the order date.
    writer.WriteAttributeString("date", XmlConvert.ToString(orderDate, "yyyy-MM-dd"))

    'Write the order time.
    writer.WriteAttributeString("time", XmlConvert.ToString(orderDate, "HH:mm:ss"))
    
    'Write the order data.
    writer.WriteElementString("orderID", orderID)
    writer.WriteElementString("custID", XmlConvert.ToString(custID))
    writer.WriteElementString("price", XmlConvert.ToString(price))

    'Write the close tag for the root element
    writer.WriteEndElement()
             

    'Write the XML and close the writer
    writer.Flush()
    writer.Close()  

  end sub
end class

ToString(Guid) ToString(Guid) ToString(Guid) ToString(Guid)

Converts the Guid to a String.

public:
 static System::String ^ ToString(Guid value);
public static string ToString (Guid value);
static member ToString : Guid -> string
Public Shared Function ToString (value As Guid) As String

Parameters

value
Guid Guid Guid Guid

The value to convert.

Returns

A string representation of the Guid.

ToString(Double) ToString(Double) ToString(Double) ToString(Double)

Converts the Double to a String.

public:
 static System::String ^ ToString(double value);
public static string ToString (double value);
static member ToString : double -> string
Public Shared Function ToString (value As Double) As String

Parameters

value
Double Double Double Double

The value to convert.

Returns

A string representation of the Double.

Examples

The following example, converts data types to string and then writes the information out to the console.

#using <System.Xml.dll>

using namespace System;
using namespace System::IO;
using namespace System::Xml;
int main()
{
   
   //Define the order data.  They will be converted to string 
   //before being written out.
   Int16 custID = 32632;
   String^ orderID = "367A54";
   DateTime orderDate = DateTime::Now;
   Double price = 19.95;
   
   //Create a writer that outputs to the console.
   XmlTextWriter^ writer = gcnew XmlTextWriter( Console::Out );
   writer->Formatting = Formatting::Indented;
   
   //Write an element (this one is the root)
   writer->WriteStartElement( "order" );
   
   //Write the order date.
   writer->WriteAttributeString( "date", XmlConvert::ToString( orderDate, "yyyy-MM-dd" ) );
   
   //Write the order time.
   writer->WriteAttributeString( "time", XmlConvert::ToString( orderDate, "HH:mm:ss" ) );
   
   //Write the order data.
   writer->WriteElementString( "orderID", orderID );
   writer->WriteElementString( "custID", XmlConvert::ToString( custID ) );
   writer->WriteElementString( "price", XmlConvert::ToString( price ) );
   
   //Write the close tag for the root element
   writer->WriteEndElement();
   
   //Write the XML and close the writer
   writer->Close();
}

using System;
using System.IO;
using System.Xml;

public class Sample
{
  public static void Main()
  {

    //Define the order data.  They will be converted to string 
    //before being written out.
    Int16 custID = 32632;
    String orderID = "367A54";
    DateTime orderDate = new DateTime();
    orderDate = DateTime.Now;
    Double price = 19.95;

    //Create a writer that outputs to the console.
    XmlTextWriter writer = new XmlTextWriter (Console.Out);
    writer.Formatting = Formatting.Indented;

    //Write an element (this one is the root)
    writer.WriteStartElement("order");

    //Write the order date.
    writer.WriteAttributeString("date", XmlConvert.ToString(orderDate, "yyyy-MM-dd"));

    //Write the order time.
    writer.WriteAttributeString("time", XmlConvert.ToString(orderDate, "HH:mm:ss"));
    
    //Write the order data.
    writer.WriteElementString("orderID", orderID);
    writer.WriteElementString("custID", XmlConvert.ToString(custID));
    writer.WriteElementString("price", XmlConvert.ToString(price));

    //Write the close tag for the root element
    writer.WriteEndElement();
             
    //Write the XML and close the writer
    writer.Close();  

  }

}
Imports System.IO
Imports System.Xml

public class Sample

  public shared sub Main()

    'Define the order data.  They will be converted to string
    'before being written out.
    Dim custID as Int16 = 32632
    Dim orderID as String = "367A54"
    Dim orderDate as DateTime 
    orderDate = DateTime.Now
    Dim price as Double = 19.95

    'Create a writer that outputs to the console.
    Dim writer as XmlTextWriter = new XmlTextWriter (Console.Out)
    'Use indenting for readability
    writer.Formatting = Formatting.Indented
    
    'Write an element (this one is the root)
    writer.WriteStartElement("order")

    'Write the order date.
    writer.WriteAttributeString("date", XmlConvert.ToString(orderDate, "yyyy-MM-dd"))

    'Write the order time.
    writer.WriteAttributeString("time", XmlConvert.ToString(orderDate, "HH:mm:ss"))
    
    'Write the order data.
    writer.WriteElementString("orderID", orderID)
    writer.WriteElementString("custID", XmlConvert.ToString(custID))
    writer.WriteElementString("price", XmlConvert.ToString(price))

    'Write the close tag for the root element
    writer.WriteEndElement()
             

    'Write the XML and close the writer
    writer.Flush()
    writer.Close()  

  end sub
end class

Remarks

If value is Double.PositiveInfinity or Double.NegativeInfinity, this method returns the string INF or -INF respectively.

See also

ToString(Decimal) ToString(Decimal) ToString(Decimal) ToString(Decimal)

Converts the Decimal to a String.

public:
 static System::String ^ ToString(System::Decimal value);
public static string ToString (decimal value);
static member ToString : decimal -> string
Public Shared Function ToString (value As Decimal) As String

Parameters

value
Decimal Decimal Decimal Decimal

The value to convert.

Returns

A string representation of the Decimal.

ToString(DateTimeOffset) ToString(DateTimeOffset) ToString(DateTimeOffset) ToString(DateTimeOffset)

Converts the supplied DateTimeOffset to a String.

public:
 static System::String ^ ToString(DateTimeOffset value);
public static string ToString (DateTimeOffset value);
static member ToString : DateTimeOffset -> string
Public Shared Function ToString (value As DateTimeOffset) As String

Parameters

Returns

A String representation of the supplied DateTimeOffset.

Examples

The following example converts a DateTimeOffset representation of the current time to a String.

using System;
using System.Xml;

class Example
{
    static void Main()
    {
        // Create the DateTimeOffset object and set the time to the current time
        DateTimeOffset dto;
        dto = DateTimeOffset.Now;

        // Convert the DateTimeOffset object to a string and display the result
        string timeAsString = XmlConvert.ToString(dto);
        Console.WriteLine(timeAsString);
    }
}
Imports System.Xml

Module Module1
    Sub Main()

        ' Create the DateTimeOffset object and set the time to the current time
        Dim dto As DateTimeOffset
        dto = DateTimeOffset.Now

        ' Convert the DateTimeOffset object to a string and display the result
        Dim timeAsString As String = XmlConvert.ToString(dto)
        Console.WriteLine(timeAsString)

    End Sub
End Module

ToString(DateTime) ToString(DateTime) ToString(DateTime) ToString(DateTime)

Warning

This API is now obsolete.

Converts the DateTime to a String.

public:
 static System::String ^ ToString(DateTime value);
[System.Obsolete("Use XmlConvert.ToString() that takes in XmlDateTimeSerializationMode")]
public static string ToString (DateTime value);
static member ToString : DateTime -> string
Public Shared Function ToString (value As DateTime) As String

Parameters

value
DateTime DateTime DateTime DateTime

The value to convert.

Returns

A string representation of the DateTime in the format yyyy-MM-ddTHH:mm:ss where 'T' is a constant literal.

Remarks

Note

The XmlConvert.ToString(DateTime) method is obsolete in the 2.0 version of the .NET Framework and has been replaced with the XmlConvert.ToString(DateTime, XmlDateTimeSerializationMode) method.

ToString(Char) ToString(Char) ToString(Char) ToString(Char)

Converts the Char to a String.

public:
 static System::String ^ ToString(char value);
public static string ToString (char value);
static member ToString : char -> string
Public Shared Function ToString (value As Char) As String

Parameters

value
Char Char Char Char

The value to convert.

Returns

A string representation of the Char.

ToString(Byte) ToString(Byte) ToString(Byte) ToString(Byte)

Converts the Byte to a String.

public:
 static System::String ^ ToString(System::Byte value);
public static string ToString (byte value);
static member ToString : byte -> string
Public Shared Function ToString (value As Byte) As String

Parameters

value
Byte Byte Byte Byte

The value to convert.

Returns

A string representation of the Byte.

ToString(Int32) ToString(Int32) ToString(Int32) ToString(Int32)

Converts the Int32 to a String.

public:
 static System::String ^ ToString(int value);
public static string ToString (int value);
static member ToString : int -> string
Public Shared Function ToString (value As Integer) As String

Parameters

value
Int32 Int32 Int32 Int32

The value to convert.

Returns

A string representation of the Int32.

Applies to