Remove ✅,

前端 未结 7 1799
离开以前
离开以前 2020-11-28 20:03

I have some strings with all kinds of different emojis/images/signs in them.

Not all the strings are in English -- some of them are in other non-Latin languages, for

7条回答
  •  醉酒成梦
    2020-11-28 20:40

    I gave some examples below, and thought that Latin is enough, but...

    Is there a way to remove all these signs from the input string and keeping only the letters & punctuation in the different languages?

    After editing, developed a new solution, using the Character.getType method, and that appears to be the best shot at this.

    package zmarcos.emoji;
    
    import java.util.Arrays;
    import java.util.HashSet;
    import java.util.Set;
    
    public class TestEmoji {
    
        public static void main(String[] args) {
            String[] arr = {"Remove ✅, 

提交回复
热议问题