. NET Framework provides a consistent, flexible, and comprehensive way to express any value, enumeration, date, and time as strings. Formatting is controlled by the character string of the format specifier, which indicates how to represent the base type value. For example, the format specifier indicates whether to use the scientific notation to represent the formatted number, or whether the formatted date should use a number or name to represent the month.
. NET Framework also uses regional settings to express the base type in a format suitable for a specific culture. You can provide custom regional settings, or use the default regional settings associated with the current thread. For example, when formatting the currency type, the regional settings specify the characters used for currency symbols, group separators, and decimal separator.
. NET framework allows you to define custom formatting schemes and custom regional settings. This feature allows you to extend the existing formatting scheme of the base type to adapt to the custom scheme, or create a custom formatting scheme for the custom type.
Content of this section
-
Formatting Overview
-
This topic describes how to format the base class library, how to format the value type, how to format the string type, and how to format a specific region.
-
Composite formatting
-
Describes how to embed one or more formatted values into a string. The string can be displayed on the console or written to the stream.
-
Numeric string
-
Describes the standard and custom format strings used to create numeric string representations.
-
Date and Time Format String
-
Describes the standard and custom format strings used to create string representations of the datetime type.
-
Enumerative Format String
-
The standard format string used to create an enumerative string representation.
-
Custom Format String
-
Provides information about the representation of custom format strings and information about adding custom format strings to custom types or existing types.
Related chapters
-
Basic string operations
-
Explains how to operate strings using several methods in the string and stringbuilder classes.
-
Analyze string
-
Describes how to initialize an object to the value described in the string representation of these objects. Analysis is a formatted reverse operation.
Address: http://msdn.microsoft.com/zh-cn/library/fbxft59x (vs.80). aspx