在目标C字符串数组中搜索字符串

编程入门 行业动态 更新时间:2024-10-27 22:28:55
本文介绍了在目标C字符串数组中搜索字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在客观C字符串数组中搜索特定字符串。有人可以帮我在这方面?

解决方案

BOOL isTheObjectThere = [myArray的containsObject:@我的字符串];

或者如果你需要知道它在哪里。

NSUInteger indexOfTheObject = [myArray的indexOfObject:@我的字符串];

我强烈建议你阅读documentation在NSArray的的。事实上,你可能应该这样做可以发布您的问题之前: - )

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"];

I strongly recommend you read the documentation on NSArray. In fact, you probably should have done that before posting your question :-)

更多推荐

在目标C字符串数组中搜索字符串

本文发布于:2023-06-09 06:28:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/596849.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   组中   目标

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!