gpt4 book ai didi

ios - 如何从字符串中删除特殊字符\u{e2}

转载 作者:行者123 更新时间:2023-11-28 05:42:55 26 4
gpt4 key购买 nike

<分区>

我在 func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool

中有以下代码
var phoneNumber: String?
if let callIntent = interaction.intent as? INStartVideoCallIntent {
phoneNumber = callIntent.contacts?.first?.personHandle?.value
} else if let callIntent = interaction.intent as? INStartAudioCallIntent {
phoneNumber = callIntent.contacts?.first?.personHandle?.value
}

电话号码只有 10 位数字。但是当我检查计数时它显示 12 位

enter image description here

当我打印字符串时

enter image description here

我试过了

phoneNumber?.trimmingCharacters(in: .whitespacesAndNewlines).countphoneNumber?.trimmingCharacters(in: .symbols).count

但它仍然返回 12

请帮忙

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