Converting .NET Framework Types to Strings
If you want to convert a .NET Framework type to a string, use the ToString method. The ToString method returns a string representation of the type passed in. The following table lists the .NET Framework types that return a string in a format that maps to the XML Schema (XSD) specifications.
.NET Framework type | String type returned |
---|---|
Boolean |
"true", "false" |
Single.PositiveInfinity |
"INF" |
Single.NegativeInfinity |
"-INF" |
Double.PositiveInfinity |
"INF" |
Double.NegativeInfinity |
"-INF" |
DateTime |
Format is yyyy-MM-ddTHH:mm:sszzzzzz and its subsets. |
Timespan |
Format is PnYnMnTnHnMnS, for example, |
See Also
Concepts
Conversion of XML Data Types
Converting Strings to .NET Framework Data Types