ios 替换 url 中的数据值

发布于 2024-12-22 08:59:59 字数 200 浏览 2 评论 0原文

我有一个字符串,用作 uiwebview 的 url,其中一些值发送到服务器,

NSString* myString = @"http://mywebsite.com?value1=10&value2=20&value3=30"

现在我希望获取一个数组或列表,其中包含具有名称/值的值...我该怎么做?

I have a string that I use as url to a uiwebview with some values sent to the server

NSString* myString = @"http://mywebsite.com?value1=10&value2=20&value3=30"

now I wish to obtain an array or a list with the values with name/value... how can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清秋悲枫 2024-12-29 08:59:59

NSString 有一个方法:componentsSeparatedByString:。使用“&”作为分隔符调用一次,然后再次使用?。我相信你可以弄清楚其余的逻辑。

NSString has a method for this: componentsSeparatedByString:. Call it once, using "&" as the separator, then again using ?. You can figure out the rest of the logic, I'm sure.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文