简体   繁体   中英

Search String in Char Array in IOS xcode program?

Char info[256]="Apple,iPhone,iPad";

I want to search in this char array, for example, search "iPhone" in the above array, Return TRUE since it contains this string.

How to do that in iOS xcode program? Thanks.

Here it is:

BOOL stringInString(char *s1, char *s2)
{
    return (strstr(s1, s2) != NULL);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM