clean method
Accurately replace/remove emojis in text strings Returns a copy of string without emoji characters/
print(RemoveEmoji().clean('π³οΈπ΄π΄ββ οΈπhiπ©πΊπ³'));
//or
print('π³οΈπ΄π΄ββ οΈπhiπ©πΊπ³'.removeEmoji);
Implementation
String clean(String text, [String word = '', bool trimText = true]) =>
trimText
? text
.replaceAll(
RegExp(
r,
),
word)
.trim()
: text.replaceAll(RegExp(r), word);