Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find value in Array in objective C

I have a NSArray structure likes this {w123,123,234,345,w124,234,235,w125,234,453,435,....}

What I am trying to do is to specify which one begins with "w" then do something But I don't know how to do that in objective C, anyone can help? Thanks in advance.

like image 973
Kin Avatar asked Mar 06 '26 17:03

Kin


1 Answers

for (NSString *text in myArray) {
    if ([text hasPrefix:@"w"]) {
       // Do something.
    }
}
like image 56
DarkDust Avatar answered Mar 08 '26 08:03

DarkDust



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!