FormattableString::Invariant Method (FormattableString^)

.NET Framework (current version)
 

Returns a result string in which arguments are formatted by using the conventions of the invariant culture.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

public:
static String^ Invariant(
	FormattableString^ formattable
)

Parameters

formattable
Type: System::FormattableString^

The object to convert to a result string.

Return Value

Type: System::String^

The string that results from formatting the current instance by using the conventions of the invariant culture.

Exception Condition
ArgumentNullException

formattable is null.

This static method can be imported in C# by the following statement:

using static System.FormattableString;

Within the scope that import directive, an interpolated string may be formatted using the conventions of the invariant culture by code such as the following:

Invariant($"{{ lat = {latitude}; lon = {longitude} }}") 

Universal Windows Platform
Available since 10
.NET Framework
Available since 4.6
Return to top
Show: