XmlConvert.ToString 메서드

정의

강력한 형식의 데이터를 동등한 String 표현으로 변환합니다.

오버로드

ToString(Single)

SingleString으로 변환합니다.

ToString(TimeSpan)

TimeSpanString으로 변환합니다.

ToString(UInt16)

UInt16String으로 변환합니다.

ToString(UInt32)

UInt32String으로 변환합니다.

ToString(DateTimeOffset, String)

제공된 DateTimeOffset을 지정된 형식의 String으로 변환합니다.

ToString(DateTime, String)

DateTimeString으로 변환합니다.

ToString(DateTime, XmlDateTimeSerializationMode)

지정된 DateTime를 사용하여 StringXmlDateTimeSerializationMode으로 변환합니다.

ToString(SByte)

SByteString으로 변환합니다.

ToString(UInt64)

UInt64String으로 변환합니다.

ToString(Int64)

Int64String으로 변환합니다.

ToString(Boolean)

BooleanString으로 변환합니다.

ToString(Int16)

Int16String으로 변환합니다.

ToString(Guid)

GuidString으로 변환합니다.

ToString(Double)

DoubleString으로 변환합니다.

ToString(Decimal)

DecimalString으로 변환합니다.

ToString(DateTimeOffset)

제공된 DateTimeOffsetString으로 변환합니다.

ToString(DateTime)
사용되지 않음.
사용되지 않음.

DateTimeString으로 변환합니다.

ToString(Char)

CharString으로 변환합니다.

ToString(Byte)

ByteString으로 변환합니다.

ToString(Int32)

Int32String으로 변환합니다.

ToString(Single)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

SingleString으로 변환합니다.

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

매개 변수

value
Single

변환할 값입니다.

반환

Single의 문자열 표현입니다.

설명

가 Single.PositiveInfinity 또는 Single.NegativeInfinity이면 value 이 메서드는 각각 INF 또는 -INF 문자열을 반환합니다.

추가 정보

적용 대상

ToString(TimeSpan)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

TimeSpanString으로 변환합니다.

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

매개 변수

value
TimeSpan

변환할 값입니다.

반환

TimeSpan의 문자열 표현입니다.

적용 대상

ToString(UInt16)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

중요

이 API는 CLS 규격이 아닙니다.

UInt16String으로 변환합니다.

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

매개 변수

value
UInt16

변환할 값입니다.

반환

UInt16의 문자열 표현입니다.

특성

적용 대상

ToString(UInt32)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

중요

이 API는 CLS 규격이 아닙니다.

UInt32String으로 변환합니다.

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

매개 변수

value
UInt32

변환할 값입니다.

반환

UInt32의 문자열 표현입니다.

특성

적용 대상

ToString(DateTimeOffset, String)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

제공된 DateTimeOffset을 지정된 형식의 String으로 변환합니다.

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

매개 변수

value
DateTimeOffset

변환될 DateTimeOffset입니다.

format
String

s를 변환할 대상 형식입니다. 형식 매개 변수는 W3C 권장 사항 중 XML dateTime 형식에 대한 부분이 될 수 있습니다. (자세한 내용은 XML 스키마 사양의 dateTime 섹션을 참조하세요.)

반환

제공된 String을 지정된 형식으로 나타낸 DateTimeOffset입니다.

예제

다음 예제에서는 DateTimeOffset 현재 시간의 표현을 지정된 형식의 로 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 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)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

DateTimeString으로 변환합니다.

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

매개 변수

value
DateTime

변환할 값입니다.

format
String

변환된 문자열을 표시하는 방법을 정의하는 형식 구조입니다. 올바른 형식에는 "yyyy-MM-ddTHH:mm:sszzzzzz" 및 그 하위 집합이 포함됩니다.

반환

지정된 형식의 DateTime에 대한 문자열 표현입니다.

예제

다음 예제에서는 데이터 형식을 문자열로 변환한 다음 콘솔에 정보를 씁니다.

#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)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

지정된 DateTime를 사용하여 StringXmlDateTimeSerializationMode으로 변환합니다.

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

매개 변수

value
DateTime

변환할 DateTime 값입니다.

dateTimeOption
XmlDateTimeSerializationMode

XmlDateTimeSerializationMode 값 처리 방법을 지정하는 DateTime 값 중 하나입니다.

반환

String에 해당하는 DateTime 값입니다.

예외

dateTimeOption 값이 올바르지 않은 경우

value 또는 dateTimeOption 값이 null인 경우

적용 대상

ToString(SByte)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

중요

이 API는 CLS 규격이 아닙니다.

SByteString으로 변환합니다.

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

매개 변수

value
SByte

변환할 값입니다.

반환

SByte의 문자열 표현입니다.

특성

적용 대상

ToString(UInt64)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

중요

이 API는 CLS 규격이 아닙니다.

UInt64String으로 변환합니다.

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

매개 변수

value
UInt64

변환할 값입니다.

반환

UInt64의 문자열 표현입니다.

특성

적용 대상

ToString(Int64)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

Int64String으로 변환합니다.

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

매개 변수

value
Int64

변환할 값입니다.

반환

Int64의 문자열 표현입니다.

적용 대상

ToString(Boolean)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

BooleanString으로 변환합니다.

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

매개 변수

value
Boolean

변환할 값입니다.

반환

Boolean에 대한 문자열 표현, 즉 "true" 또는 "false"입니다.

적용 대상

ToString(Int16)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

Int16String으로 변환합니다.

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

매개 변수

value
Int16

변환할 값입니다.

반환

Int16의 문자열 표현입니다.

예제

다음 예제에서는 데이터 형식을 문자열로 변환한 다음 콘솔에 정보를 씁니다.

#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)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

GuidString으로 변환합니다.

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

매개 변수

value
Guid

변환할 값입니다.

반환

Guid의 문자열 표현입니다.

적용 대상

ToString(Double)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

DoubleString으로 변환합니다.

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

매개 변수

value
Double

변환할 값입니다.

반환

Double의 문자열 표현입니다.

예제

다음 예제에서는 데이터 형식을 문자열로 변환한 다음 콘솔에 정보를 씁니다.

#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

설명

가 Double.PositiveInfinity 또는 Double.NegativeInfinity이면 value 이 메서드는 각각 INF 또는 -INF 문자열을 반환합니다.

추가 정보

적용 대상

ToString(Decimal)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

DecimalString으로 변환합니다.

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

매개 변수

value
Decimal

변환할 값입니다.

반환

Decimal의 문자열 표현입니다.

적용 대상

ToString(DateTimeOffset)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

제공된 DateTimeOffsetString으로 변환합니다.

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

매개 변수

value
DateTimeOffset

변환될 DateTimeOffset입니다.

반환

제공된 StringDateTimeOffset 표현입니다.

예제

다음 예제에서는 현재 시간의 표현을 로 String변환 DateTimeOffset 합니다.

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)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

주의

Use XmlConvert.ToString() that takes in XmlDateTimeSerializationMode

주의

Use XmlConvert.ToString() that accepts an XmlDateTimeSerializationMode instead.

DateTimeString으로 변환합니다.

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

매개 변수

value
DateTime

변환할 값입니다.

반환

형식이 yyyy-MM-ddTHH:mm:ss(여기서 'T'는 상수 리터럴)인 DateTime에 대한 문자열 표현입니다.

특성

설명

참고

메서드는 XmlConvert.ToString(DateTime) 2.0 버전의 .NET Framework 사용되지 않으며 메서드로 XmlConvert.ToString(DateTime, XmlDateTimeSerializationMode) 대체되었습니다. 제안된 모드는 입니다 RoundtripKind. 정확히 일치하는 항목이 필요한 경우 형식 문자열 yyyy-MM-ddTHH:mm:ss.fffffffzzzzzz과 함께 를 사용 XmlConvert.ToString(DateTime, String) 하세요.

적용 대상

ToString(Char)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

CharString으로 변환합니다.

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

매개 변수

value
Char

변환할 값입니다.

반환

Char의 문자열 표현입니다.

적용 대상

ToString(Byte)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

ByteString으로 변환합니다.

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

매개 변수

value
Byte

변환할 값입니다.

반환

Byte의 문자열 표현입니다.

적용 대상

ToString(Int32)

Source:
XmlConvert.cs
Source:
XmlConvert.cs
Source:
XmlConvert.cs

Int32String으로 변환합니다.

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

매개 변수

value
Int32

변환할 값입니다.

반환

Int32의 문자열 표현입니다.

적용 대상