查找字符串中字符的索引 [英] Find the index of a character in a string
本文介绍了查找字符串中字符的索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个字符串 NSString * Original = @88)12-sep-2012;
或 Original = @8)blablabla ;
我想只打印)之前的字符,以便如何找到字符)的索引。或者我该怎么办?
I want to print only the characters before the ")" so how to find the index of the character ")". or how could i do it?
提前致谢。
推荐答案
NSString *str = [[yourString componentsSeparatedByString:@")"] objectAtIndex:0];
这篇关于查找字符串中字符的索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文