diff --git a/habbgo/text/string.go b/habbgo/text/string.go index 3116807..b2e1904 100644 --- a/habbgo/text/string.go +++ b/habbgo/text/string.go @@ -1,6 +1,9 @@ package text -import "strings" +import ( + "strconv" + "strings" +) func Filter(s string) string { output := strings.Replace(s, string(rune(1)), "", -1) @@ -24,6 +27,16 @@ func ContainsAllowedChars(toTest, allowedChars string) bool { return true } +func ContainsANumber(text string) bool { + for _, l := range text { + if _, err := strconv.Atoi(string(l)); err == nil { + return true + } + } + + return false +} + /* public static boolean hasAllowedCharacters(String str, String allowedChars) { if (str == null) {