The in and not in operators

The in operator tests if one string is a substring of another:




(chp8_in1)

Note that a string is a substring of itself, and the empty string is a substring of any other string. (Also note that computer scientists like to think about these edge cases quite carefully!)




(chp8_in2)

The not in operator returns the logical opposite result of in.




(chp8_in3)

Następna część - The Accumulator Pattern with Strings