I'm running a data science project and i need your help.
My string is:
string = '🎁Test'
and I expect that output:
s1 = '🎁's2 = 'Test'
I'm running a data science project and i need your help.
My string is:
string = '🎁Test'
and I expect that output:
s1 = '🎁's2 = 'Test'
I'll assume that your string is always of the form "<emoticon><alphabets>"
. I'll then splice the string.
# Count number of alphabets first
num = [c.isalpha() for c in string].count(True)
# Splice string based on the result
s1 = string[:-num]
s2 = string[-num:]