How to check if NSString begins with a certain characteradmin管理员组文章数量:1566601
How to check if NSString begins with a certain character
How do you check if an NSString begins with a certain character (the character *).
The * is an indicator for the type of the cell, so I need the contents of this NSString without the *, but need to know if the * exists.
You can use the -hasPrefix:
method of NSString
:
NSString* output = nil; if([string hasPrefix:@"*"]) output = [string substringFromIndex:1];
posted on 2014-07-14 14:36 罗斯摩根 阅读( ...) 评论( ...) 编辑 收藏
转载于:https://wwwblogs/savagemorgan/p/3842672.html
本文标签: NSStringcheckcharacterbegins
版权声明:本文标题:How to check if NSString begins with a certain character 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1727341138a1109423.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论