将 NSDictionary 解析为带有自定义分隔符的字符串
我有一个 NSMutableDictionary,其中包含一些值,我需要将键和值连接到一个字符串中,因此
> name = Fred
> password = cakeismyfavoritefood
> email = [email protected]
变为 name=Fred&password=cakeismyfavoritefood&[电子邮件受保护]
我该如何执行此操作?有没有办法将 NSDictionaries 连接到字符串中?
I have an NSMutableDictionary with some values in it, and I need to join the keys and values into a string, so
> name = Fred
> password = cakeismyfavoritefood
> email = [email protected]
becomes name=Fred&password=cakeismyfavoritefood&[email protected]
How can I do this? Is there a way to join NSDictionaries
into strings?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以轻松地枚举字典键和对象:
You can easily do that enumerating dictionary keys and objects:
与 使用块将 NSDictionary 转换为字符串?
Quite same question as Turning a NSDictionary into a string using blocks?