<分区>
如何在 Swift 的阿拉伯字符串中使用 String(format:)
?
let seconds = 458569
我的代码是:
let arabicStr = "لديك ٪d ثانية متبقية للاتصال"
let Str = String(format: arabicStr,seconds)
和输出:
لديك d٪ ثانية متبقية للاتصال
<分区>
如何在 Swift 的阿拉伯字符串中使用 String(format:)
?
let seconds = 458569
我的代码是:
let arabicStr = "لديك ٪d ثانية متبقية للاتصال"
let Str = String(format: arabicStr,seconds)
和输出:
لديك d٪ ثانية متبقية للاتصال
最佳答案
试试这段代码。
let seconds = 458569
let Str = "لديك \(seconds) ثانية متبقية للاتصال"
print(Str);
或
let Str2 = String(format: "لديك %d ثانية متبقية للاتصال",seconds)
print(Str2);
关于swift - 让 Str = 字符串(格式 : "لديك d٪ ثانية متبقية للاتصال", 秒),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49532154/
相关文章:
iOS - 如何使用来自 NIB 的特定框架初始化自定义 UIView
ios - 动态 viewForHeaderInSection 和多个 cellForRowAtIndexPath
facebook - 从 Facebook Graph API 获取语言代码/区域
android - 更改设备语言后,我的应用程序的语言没有改变
python - 类型错误:不支持的操作数类型为 %: 'NoneType' 和 'str'
macos - Swift 协议(protocol)方法与父类(super class)属性冲突
ios swift CMutableVoidPointer 在 observeValueForKeyPath 中无法识别