FormattableString.CurrentCulture(FormattableString) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個結果字串,參數以當前文化的慣例格式化。
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
要格式化的字串。
傳回
這是透過使用當前文化慣例格式化當前實例所產生的字串。
備註
此靜態方法可透過以下方式以 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} }}"