Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // returns true iff string key is contained in string sentence
- bool isPartOf(char* key, char* sentence){
- char *it=key, *s=sentence, *start=s;
- while(true){
- if(!*it){ return true; }
- if(!*s){ return false; }
- *it != *s ? (it=key,start++,s=start) : (it++,s++);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement