XmlConvert.ToString Methode
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Konvertiert stark typisierte Daten in eine gleichbedeutende String-Darstellung.
Überlädt
ToString(Single) | |
ToString(TimeSpan) | |
ToString(UInt16) | |
ToString(UInt32) | |
ToString(DateTimeOffset, String) |
Konvertiert den angegebenen DateTimeOffset in einen String im angegebenen Format. |
ToString(DateTime, String) | |
ToString(DateTime, XmlDateTimeSerializationMode) |
Konvertiert die DateTime-Struktur mithilfe von XmlDateTimeSerializationMode in eine String. |
ToString(SByte) | |
ToString(UInt64) | |
ToString(Int64) | |
ToString(Boolean) | |
ToString(Int16) | |
ToString(Guid) | |
ToString(Double) | |
ToString(Decimal) | |
ToString(DateTimeOffset) |
Konvertiert den angegebenen DateTimeOffset in einen String. |
ToString(DateTime) |
Veraltet.
Veraltet.
|
ToString(Char) | |
ToString(Byte) | |
ToString(Int32) |
ToString(Single)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
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
Parameter
- value
- Single
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des Single.
Hinweise
Wenn value
Single.PositiveInfinity oder Single.NegativeInfinity ist, gibt diese Methode die Zeichenfolge INF bzw. -INF zurück.
Weitere Informationen
Gilt für:
ToString(TimeSpan)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
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
Parameter
- value
- TimeSpan
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des TimeSpan
.
Gilt für:
ToString(UInt16)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
Wichtig
Diese API ist nicht CLS-kompatibel.
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
Parameter
- value
- UInt16
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des UInt16.
- Attribute
Gilt für:
ToString(UInt32)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
Wichtig
Diese API ist nicht CLS-kompatibel.
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
Parameter
- value
- UInt32
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des UInt32.
- Attribute
Gilt für:
ToString(DateTimeOffset, String)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
Konvertiert den angegebenen DateTimeOffset in einen String im angegebenen 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
Parameter
- value
- DateTimeOffset
Der zu konvertierende DateTimeOffset.
- format
- String
Das Format, in das s
konvertiert wird. Der Formatparameter kann eine beliebige Teilmenge der W3C-Empfehlung für den XML-DateTime-Typ sein. (Weitere Informationen finden Sie im dateTime-Abschnitt der XML-Schemaspezifikation.)
Gibt zurück
Eine String-Darstellung im angegebenen Format des bereitgestellten DateTimeOffset.
Beispiele
Im folgenden Beispiel wird eine DateTimeOffset Darstellung der aktuellen Zeit in eine String im angegebenen Format konvertiert.
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
Gilt für:
ToString(DateTime, String)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
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
Parameter
- value
- DateTime
Der zu konvertierende Wert.
- format
- String
Die Formatstruktur, die die Anzeige der konvertierten Zeichenfolge definiert. Zu den gültigen Format zählt „yyyy-MM-ddTHH:mm:sszzzzzz“ und dessen Teilmengen.
Gibt zurück
Eine Zeichenfolgendarstellung von DateTime
im angegebenen Format.
Beispiele
Im folgenden Beispiel werden Datentypen in eine Zeichenfolge konvertiert und dann die Informationen in die Konsole geschrieben.
#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
Gilt für:
ToString(DateTime, XmlDateTimeSerializationMode)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
Konvertiert die DateTime-Struktur mithilfe von XmlDateTimeSerializationMode in eine String.
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
Parameter
- dateTimeOption
- XmlDateTimeSerializationMode
Einer der XmlDateTimeSerializationMode-Werte, die angeben, wie der DateTime-Wert behandelt wird.
Gibt zurück
Ein String-Äquivalent von DateTime.
Ausnahmen
Der dateTimeOption
-Wert ist nicht zulässig.
Der value
-Wert oder der dateTimeOption
-Wert ist null
.
Gilt für:
ToString(SByte)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
Wichtig
Diese API ist nicht CLS-kompatibel.
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
Parameter
- value
- SByte
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des SByte
.
- Attribute
Gilt für:
ToString(UInt64)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
Wichtig
Diese API ist nicht CLS-kompatibel.
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
Parameter
- value
- UInt64
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des UInt64.
- Attribute
Gilt für:
ToString(Int64)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
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
Parameter
- value
- Int64
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des Int64.
Gilt für:
ToString(Boolean)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
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
Parameter
- value
- Boolean
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung von Boolean
, d. h. „true“ oder „false“.
Gilt für:
ToString(Int16)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
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
Parameter
- value
- Int16
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des Int16.
Beispiele
Im folgenden Beispiel werden Datentypen in eine Zeichenfolge konvertiert und dann die Informationen in die Konsole geschrieben.
#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
Gilt für:
ToString(Guid)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
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
Parameter
- value
- Guid
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des Guid
.
Gilt für:
ToString(Double)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
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
Parameter
- value
- Double
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des Double.
Beispiele
Im folgenden Beispiel werden Datentypen in eine Zeichenfolge konvertiert und dann die Informationen in die Konsole geschrieben.
#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
Hinweise
Wenn value
Double.PositiveInfinity oder Double.NegativeInfinity ist, gibt diese Methode die Zeichenfolge INF bzw. -INF zurück.
Weitere Informationen
Gilt für:
ToString(Decimal)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
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
Parameter
- value
- Decimal
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des Decimal
.
Gilt für:
ToString(DateTimeOffset)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
Konvertiert den angegebenen DateTimeOffset in einen 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
Parameter
- value
- DateTimeOffset
Der zu konvertierende DateTimeOffset.
Gibt zurück
Eine String-Darstellung des angegebenen DateTimeOffset.
Beispiele
Im folgenden Beispiel wird eine DateTimeOffset Darstellung der aktuellen Zeit in eine Stringkonvertiert.
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
Gilt für:
ToString(DateTime)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
Achtung
Use XmlConvert.ToString() that takes in XmlDateTimeSerializationMode
Achtung
Use XmlConvert.ToString() that accepts an XmlDateTimeSerializationMode instead.
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
Parameter
- value
- DateTime
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung von DateTime
im Format „yyyy-MM-ddTHH:mm:ss , wobei „T“ ein konstantes Literal ist.
- Attribute
Hinweise
Hinweis
Die XmlConvert.ToString(DateTime) Methode ist in der Version 2.0 der .NET Framework veraltet und wurde durch die XmlConvert.ToString(DateTime, XmlDateTimeSerializationMode) -Methode ersetzt.
Der vorgeschlagene Modus ist RoundtripKind. Wenn eine genaue Übereinstimmung erwartet wird, verwenden XmlConvert.ToString(DateTime, String) Sie bitte mit der Formatzeichenfolge yyyy-MM-ddTHH:mm:ss.fffffffzzzzzz
.
Gilt für:
ToString(Char)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
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
Parameter
- value
- Char
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des Char
.
Gilt für:
ToString(Byte)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
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
Parameter
- value
- Byte
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des Byte
.
Gilt für:
ToString(Int32)
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
- Quelle:
- XmlConvert.cs
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
Parameter
- value
- Int32
Der zu konvertierende Wert.
Gibt zurück
Eine Zeichenfolgendarstellung des Int32.