remove emoji strings from display name
This commit is contained in:
parent
f4af81947e
commit
0928803a34
1 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
package utilities
|
package utilities
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
@ -63,7 +64,10 @@ func FieldFormat(text string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func DisplayNameFormat(text string) string {
|
func DisplayNameFormat(text string) string {
|
||||||
return boldmagenta + text + reset
|
// use this pattern to remove all emoji strings
|
||||||
|
pattern := regexp.MustCompile(`\s:[A-Za-z0-9]*:`)
|
||||||
|
|
||||||
|
return boldmagenta + pattern.ReplaceAllString(text, "") + reset
|
||||||
}
|
}
|
||||||
|
|
||||||
func FormatDate(date time.Time) string {
|
func FormatDate(date time.Time) string {
|
||||||
|
|
Loading…
Reference in a new issue