how to fetch all chars of a string before a space in python

Solutions on MaxInterview for how to fetch all chars of a string before a space in python by the best coders in the world

showing results for - "how to fetch all chars of a string before a space in python"
Liam
29 Jun 2017
1>>> s1.split(':')
2['Username', ' How are you today?']
3>>> s1.split(':')[0]
4'Username'