Logo

Programming-Idioms

History of Idiom 39 > diff from v51 to v52

Edit summary for version 52 by OC:
New Obj-C implementation by user [OC]

Version 51

2020-06-15, 21:14:03

Version 52

2020-10-10, 22:22:17

Idiom #39 Check if string contains a word

Set boolean ok to true if string word is contained in string s as a substring, or to false otherwise.

Idiom #39 Check if string contains a word

Set boolean ok to true if string word is contained in string s as a substring, or to false otherwise.

Variables
ok,word,s
Variables
ok,word,s
Imports
@import Foundation;
Code
BOOL ok=[s containsString:word];
Comments bubble
This check is case-sensitive, locale-unaware. There are similar messages for other cases