gpt4 book ai didi

ios 如何从应用商店 url 中提取 ID 号部分?

转载 作者:行者123 更新时间:2023-11-28 18:53:17 26 4
gpt4 key购买 nike

我想从应用商店网址中提取 ID 号部分,例如,以下是两个应用商店网址: https://itunes.apple.com/app/apple-store/id882456583?pt=63826800&ct=%E5%AE%A3%E4%BC%A0%E8%B4%B4001&mt=8

https://itunes.apple.com/app/juan-pi-zhe-kou-shou-ji-shang/id639388447?mt=8&uo=4

我想提取“id”后面的数字,即 882456583 和 639388447。任何人都知道如何做到这一点?谢谢。

最佳答案

试试这个

swift :

let appStoreUrl = NSURL(string: "https://itunes.apple.com/app/juan-pi-zhe-kou-shou-ji-shang/id639388447?mt=8&uo=")
let appId = appStoreUrl?.lastPathComponent?.stringByReplacingOccurrencesOfString("id", withString: "")

objective-c :

NSURL *appStoreUrl = [NSURL URLWithString:@"https://itunes.apple.com/app/juan-pi-zhe-kou-shou-ji-shang/id639388447?mt=8&uo="];
NSString *appId = [appStoreUrl.lastPathComponent stringByReplacingOccurrencesOfString:@"id" withString:@""];

结果:

enter image description here

关于ios 如何从应用商店 url 中提取 ID 号部分?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37289648/

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