mirror of
https://github.com/pikami/rss-dl.git
synced 2025-12-22 18:40:12 +00:00
Initial commit
This commit is contained in:
15
helpers/string_methods.go
Normal file
15
helpers/string_methods.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"log"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
// ToCleanString - replaces spaces with underscores
|
||||
func ToCleanString(str string) string {
|
||||
reg, err := regexp.Compile("[^A-Za-z0-9]+")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
return reg.ReplaceAllString(str, "_")
|
||||
}
|
||||
Reference in New Issue
Block a user