FormattableString.CurrentCulture(FormattableString) 方法

定義

傳回結果字串,其引數會使用目前文化特性的慣例來格式化。

public:
 static System::String ^ CurrentCulture(FormattableString ^ formattable);
public static string CurrentCulture (FormattableString formattable);
static member CurrentCulture : FormattableString -> string
Public Shared Function CurrentCulture (formattable As FormattableString) As String

參數

formattable
FormattableString

要格式化的字串。

傳回

String

使用目前文化特性慣例將目前執行個體格式化所產生的字串。

備註

此靜態方法可透過下列方式在 C# 或 F# 中匯入:

using static System.FormattableString;

''fsharp 開啟類型 System.FormattableString

Within the scope of that import directive, an interpolated string may be formatted in the current culture by writing, for example:
```csharp
    CurrentCulture($"{{ lat = {latitude}; lon = {longitude} }}");
    CurrentCulture $"{{ lat = {latitude}; lon = {longitude} }}"

適用於