Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

# convert a string to words

# convert a string to words
import re
s = ('Python is an interpreted, object-oriented, high-level programming language with dynamic semantics.')
pattern = '[a-zA-Z-]+'
words= re.findall(pattern, s)
print(words)

['Python',
 'is',
 'an',
 'interpreted',
 'object-oriented',
 'high-level',
 'programming',
 'language',
 'with',
 'dynamic',
 'semantics']
 
PREVIOUS NEXT
Tagged: #convert #string #words
ADD COMMENT
Topic
Name
9+5 =