string - Python in operator looking for "night" but not counting "knight" -


this question has answer here:

i writing program needs find word "night" in string, not word "knight". know write

if "night" in string , "knight" not in string 

but want still include strings include @ least 1 night.

later on replaces word night knight, how both fix conditional , correctly replace string "night" "knight" (even if part of word)


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -