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} }}"