gpt4 book ai didi

arrays - Swift 中的阿拉伯语文本

转载 作者:行者123 更新时间:2023-11-30 10:24:16 25 4
gpt4 key购买 nike

我有这样的对象数组

"sub-specialty" : [
{
"id" : 1,
"title" : "Adult Physiotherapy",
"ar_title" : "علاج طبيعي بالغين",
"name" : "علاج طبيعي بالغين"
},
{
"id" : 2,
"title" : "Pediatric Physiotherapy",
"ar_title" : "علاج طبيعي اطفال",
"name" : "علاج طبيعي اطفال"
},
{
"id" : 3,
"title" : "Sport Injuries",
"ar_title" : "اصابات ملاعب",
"name" : "اصابات ملاعب"
},
{
"id" : 4,
"title" : "Rehabilitation",
"ar_title" : "تأهيل",
"name" : "تأهيل"
}
]

当我使用 map 仅像这样获取名称时

let sub = sub-specialty.map({($0.name ?? "")}).joined(separator: ", ") ?? ""

我有垃圾字符或文本被翻转,请参阅附图

enter image description here

最佳答案

您需要将文本获取为字符串并设置在您想要设置的任何位置。它会工作得很好。我曾使用过多种语言,这对我来说很有效。

关于arrays - Swift 中的阿拉伯语文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60164363/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com