string if it doesnt contain?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By siten0308

simple question probably, but if have a string, and want to make sure if it contains a certain character or phrase, i know there is one with an IN, example:

if "i" in "team":

however it would have been great, with that same idea, to do a NOT IN… but is there another property/build in function that can accomplish this?

:bust_in_silhouette: Reply From: Mario

You were close. So close!

You can basically use the same expression, just negate it by using the keyword not in front of the expression to be negated:

if not "i" in "team": # always true
    pass

uuuuhhh dang thats going to haunt me… but all the more reason i will remember, big thank you sir :slight_smile:

siten0308 | 2021-04-07 18:59