/*** Filter Emoji expression *@authorKunjie * July 17, 2015*/ Public classEmojifilter { Public Static voidMain (string[] args) {System.out.println ("Ah, Assad, Qinnuanl.")); } Public Staticstring Filter (String str) {if(str = =NULL|| Str.length () = = 0){ return""; } stringbuffer SB=NewStringBuffer (); for(intI=0;i<str.length () -1;i++){ intCH =Str.charat (i); intmin = Integer.parseint ("E001", 16); intmax = Integer.parseint ("E537", 16); if(ch >= min && ch <=max) {Sb.append (""); }Else{sb.append (Char) ch); } } returnsb.tostring (); } }
Each expression has a SB Unicode encoding.
such as the sun expression, then SB code for E04A, is 16 binary.
Find the smallest E001, E537,
It is then converted to a 10 binary comparison size. Within this range, it is the emoji expression character.
Java filters emoji Emoticons to find the Unicode range of the emoji.