how can I say if a string hit https (with no space) split it into two words? For example in Join us!https://t.co/Fe0oTahdom
want to make it like Join us!
and https://t.co/Fe0oTahdom
Simplest way if you are only going to split on the https
keyword
myString = 'Join us!https://t.co/Fe0oTahdom'
(head, sep, tail) = myString.partition('https')
print head #Prints Join us!
print sep + tail #Prints the rest
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句