Jan-21-2024, 05:57 AM
There are several ways to do this. One is to use string find() method and then check where the next space is. Another way is to use regular expressions, which will be faster if you have a large text and you want to find all occurrences. You can also try
if 'fr' in your_sentence
code in case you just want to check membership.