Check if the string contains all inputs on the list

后端 未结 3 1635
囚心锁ツ
囚心锁ツ 2021-01-04 12:11

I want to be able to check if the string contains all the values held in the list; So it will only give you a \'correct answer\' if you have all the \'key words\' from the l

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-04 12:41

    This should help:

     string text = "Psychology is the study of mental process and behaviour of humans";
     bool containsAllKeyWords = KeyWords.All(text.Contains);
    

提交回复
热议问题