目标c中字符串数组中的字符串搜索 [英] String search in string array in objective c
本文介绍了目标c中字符串数组中的字符串搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在目标 c 的字符串数组中搜索特定字符串.有人可以在这方面帮助我吗?
I want to search a specific string in the array of strings in objective c. Can somebody help me in this regard?
推荐答案
BOOL isTheObjectThere = [myArray containsObject: @"my string"];
或者如果您需要知道它在哪里
or if you need to know where it is
NSUInteger indexOfTheObject = [myArray indexOfObject: @"my string"];
我强烈建议您阅读 关于 NSArray 的文档.最好在发布您的问题之前这样做:-)
I strongly recommend you read the documentation on NSArray. It's best to do that before posting your question :-)
这篇关于目标c中字符串数组中的字符串搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文