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