我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

从Objective-c中的php获取返回字符串的一部分[复制]

This question already has an answer here:

  • Split up NSString using a comma 5 answers

I get a response value from PHP code that goes like that:

"success, 32"

How can I display in NsLog the first part of the value before the - "," and the second part separately?

</div>

Break the string into an array of chunks:

NSArray *chunks = [string componentsSeparatedByString: @","];

then display the chunk you want:

NSLog(@"%@", chunks[0]);

or

NSLog(@"%@", chunks[1]);

近期文章

  • 如何避免在Jquery中验证几个文本框
  • PHP,从sql数据库显示泰国字符
  • 如何更改使用多个构造函数?
  • 如何在测试时模拟CakeRquest对象
  • 选择与当前商店实体相关的类别
  • 使用JSON从MySQL数据库获取的数据错误
  • 验证mysql行是否与另一行冲突
  • FusionCharts无法使用MySQL显示MySQL的数据
  • PHP LDAP绑定AD与服务器的用户帐户
  • 如何在下载框出现时重定向页面?
  • 发布到Facebook而不显示应用程序名称
  • Android / PHP-在Web服务器上发送txt文件?
  • 如何在使用php-fpm时从终端运行php -v
  • HybridAuth小部件不会出现在Drupal网站上
  • 如何验证电子邮件以继续注册[关闭]
  • PHP按类名调用类的静态方法
  • 如何捕获脚本标记返回的值
  • 使用$ .post从表单接收php服务器中的数据
  • PHP选择带有三元运算符的动态选项[关闭]
  • PHP SESSION VAR存在但PHP消息:PHP注意:

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华