how do i find a character in a text and then copy the word that had that character python

Arthur

i want to extract a word out of a string based on what character it got, for Example:

string: I WANT TO EAT cheese in zeven11

Extract all words with 11 in it

extracted: Zeven11

i try find() method but then i only get a on number of the word

Daniel Hao

Maybe something like this:

for word in string.split():
    if '11' in word: print(word.capitalize())  # first letter?

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I print the Nth character of the Nth word in a line?

How do I remove text before a specified character in MySQL?

How do I find out if first character of a string is a number?

How do I find a character followed by a character in a char array Java?

In vim How Do I Put a Character Before and After a Word

How do I find a character matching my alt code

How do I find a character and look forward and back?

How do I find something in a text file that is before a character

How do I find a Unicode character by its name?

how to find if there is next character to word in python?

How do I display Label text character-by-character?

How do I find character frequency form text file through iteration? (python3)

How do i find the numbers that is not followed by a word character with regex?

How to find number the number of a specific character in a word?

What is the ^I character and how do I find it with sed?

How to find the the word position (not character position) in a string

How do I find which character "var in var" is in in python

How to copy text untill newline character?

How do I detect the character encoding of a text

how to find the position of a character that sql had selected it

How do I make undo/redo in <textarea> to react on 1 word at a time, word by word or character by character?

find out: In how many word a character is present in a given Sentence: PYTHON

How do I find the key code of a character in C#?

How do I find what text had been added with TextChanged

How to remove word which i connect with special character in python

How to separate a word in a list character by character in python?

Python - How do i delete more than one character on python using slice method, find and rfind

How can I copy all text after = character?

How do I find the source or a rogue character on my page?