all
This commit is contained in:
14
Downloads/Voltaserve/conversion/helper/string.go
Normal file
14
Downloads/Voltaserve/conversion/helper/string.go
Normal file
@ -0,0 +1,14 @@
|
||||
package helper
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func RemoveNonNumeric(s string) string {
|
||||
reg, err := regexp.Compile("[^0-9]+")
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return strings.TrimSpace(reg.ReplaceAllString(s, ""))
|
||||
}
|
Reference in New Issue
Block a user