How do I check for an EXACT word in a string in python

后端 未结 7 2063
再見小時候
再見小時候 2020-12-01 18:27

Basically I need to find a way to figure out a way to find the EXACT word in a string. All the information i have read online has only given me how to search for letters in

7条回答
  •  再見小時候
    2020-12-01 18:44

    Break up the string into a list of strings with .split() then use the in operator.

    This is much simpler than using regular expressions.

提交回复
热议问题