stripColons static method
Strip colons for emoji name. So, ':heart:' will become 'heart'.
Implementation
static String stripColons(String name, [void Function(String message)? errorCall]) {
Iterable<Match> matches = EmojiParser.regexName.allMatches(name);
if (matches.isEmpty) {
if (errorCall != null) {
errorCall(EmojiMessage.errorMalformedEmojiName);
}
return name;
}
return name.replaceAll(EmojiConst.charColon, EmojiConst.charEmpty);
}