аватар question@mail.ru · 01.01.1970 03:00

Cut all the emoticons from the line

Suppose we have a line:

   "" ????????? & zwj; ?? ?? & zwj; ?? & zwj; ❤ & zwj; ? & zwj; ?????✋??? What a wonderful day! ""      

as this from this one from this Remove all the emoticons and get only a pure text at the output:

    

In this case, the emoticons can be completely different not necessarily those in the line.

аватар answer@mail.ru · 01.01.1970 03:00

Try this:

  # pip install emoji    IMPORT  emojitext =  "" ???????? ?????????????? ??????? & zwj; ?? & zwj; ?? & zwj; ❤ & zwj; ? ?????✋?✋works beautiful day! ""  new_text =  ''  .join (Char  for  char  in  text  if  char = ""> not   in  emoji.unicode_emoji)   print  (New_text)  # & zwj; & zwj; & zwj; & zwj; & zwj; what a wonderful day!                                    

Latest

Similar