Android - How to filter emoji (emoticons) from a string?

前端 未结 4 1281
天命终不由人
天命终不由人 2020-12-09 00:22

I\'m working on an Android app, and I do not want people to use emoji in the input.

How can I remove emoji characters from a string?

4条回答
  •  离开以前
    2020-12-09 00:48

    For those using Kotlin, Char.isSurrogate can help as well. Find and remove the indexes that are true from that.

提交回复
热议问题