Unit.ToString Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Converts a Unit to a string equivalent.
ToString() | |
ToString(CultureInfo) |
Converts a Unit to a string equivalent in the specified culture. |
ToString(IFormatProvider) |
Converts a Unit to a string equivalent using the specified format provider. |
public:
override System::String ^ ToString();
public override string ToString();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
Returns
A String that represents this Unit.
See also
Applies to
.NET Framework 4.8.1 e altre versioni
Prodotto | Versioni |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Converts a Unit to a string equivalent in the specified culture.
public:
System::String ^ ToString(System::Globalization::CultureInfo ^ culture);
public string ToString(System.Globalization.CultureInfo culture);
override this.ToString : System.Globalization.CultureInfo -> string
Public Function ToString (culture As CultureInfo) As String
Parameters
- culture
- CultureInfo
A CultureInfo that represents the culture.
Returns
A String represents this Unit in the culture specified by culture
.
Remarks
Use the ToString method to convert the Unit that this method is called from to a string equivalent in the specified culture.
See also
Applies to
.NET Framework 4.8.1 e altre versioni
Prodotto | Versioni |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Converts a Unit to a string equivalent using the specified format provider.
public:
System::String ^ ToString(IFormatProvider ^ formatProvider);
public string ToString(IFormatProvider formatProvider);
override this.ToString : IFormatProvider -> string
Public Function ToString (formatProvider As IFormatProvider) As String
Parameters
- formatProvider
- IFormatProvider
An IFormatProvider interface implementation that supplies culture-specific formatting information.
Returns
A String representing this Unit in the format specified by formatProvider
.
Remarks
The ToString method returns a string representation formatted with a unit Value and an abbreviation representing the unit Type. The following table lists UnitType values and their corresponding abbreviation.
Use formatProvider
to specify culture-specific information used to format the Value. If formatProvider
is null
, the numeric portion of the string is formatted using a default NumberFormatInfo object set for the current culture.
See also
Applies to
.NET Framework 4.8.1 e altre versioni
Prodotto | Versioni |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Feedback su .NET
.NET è un progetto di open source. Selezionare un collegamento per fornire feedback: