string_sanitisation.go
302 Bytes
package webutility
import "strings"
const patern = "\"';&*<>=\\`:"
// SanitiseString removes characters from s found in patern and returns new modified string.
func SanitiseString(s string) (safe string) {
for _, c := range patern {
safe = strings.Replace(s, string(c), "", -1)
}
return safe
}