How to get the first word in a string Python?

Today, We want to share with you python get first word in string.In this post we will show you string split, hear for how to extract a word from a string we will give you demo and example for implement.In this post, we will learn about How To Check If String Contains Substring In PHP? with an example.

get first word in string python

Method #1: Using split()

Get first word in string

string = "Welcomes Pakainfo"
results = string.split()
first_word= results[0]



Get the All words in a string


string = "Welcomes Pakainfo is the easy Free Application Development Welcomes Guyes"
results = string.split()


['Welcomes', 'Pakainfo', 'is', 'the', 'easy', 'Free', 'Application', 'Development', 'Welcomes', 'Guyes']

I hope you get an idea about python get second word in string.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Also Read This 👉   python remove newline - How to remove a trailing newline in Python?