Issue
How do split string by apostrophe '
and -
?
For example, given
string = "pete - he's a boy"
Solution
You can use the regular expression module's split function:
re.split("['-]", "pete - he's a boy")
Answered By - Uwe Kleine-König
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.