Logo

Programming-Idioms

History of Idiom 39 > diff from v5 to v6

Edit summary for version 6 by :

Version 5

2015-08-19, 14:49:23

Version 6

2015-08-19, 14:52:36

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.

Imports
#include <string.h>
Code
int ok=strstr(s,word)!=NULL;