helper functions

This commit is contained in:
jtieri 2021-09-16 23:07:33 -05:00
parent 72942d5e2b
commit 82144c737c
1 changed files with 14 additions and 1 deletions

View File

@ -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) {