In Natural language processing which is a subfield of linguistic, computer science and artificial intelligence, operating on text is the key. Some of the operations are: verifying if a word exists in a text, counting the number of unique words in a text, getting all positions of a certain word in a text and many more.
In this section, we shall cover just a tip of the iceberg of what is required in NLP.
Verify if Substring Exists
In the most basic ways, we can verify if a substring is present in a string with either the in operator or the String find() method.