Filter to AlphaNumerics
Examples
Filter
package main
import (
"fmt"
"regexp"
)
func main() {
example := "#GoLangCode!$!"
// Make a Regex to say we only want letters and numbers
reg, err := regexp.Compile("[^a-zA-Z0-9]+")
if err != nil {
panic(err)
}
processedString := reg.ReplaceAllString(example, "")
fmt.Println(processedString)
}