ios 替换 url 中的数据值
我有一个字符串,用作 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.