Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python extract all characters from string before a character

s1 = "Username: How are you today?"
>>> s1.split(':')
['Username', ' How are you today?']
>>> s1.split(':')[0]
'Username'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #extract #characters #string #character
ADD COMMENT
Topic
Name
1+5 =