mirror of
https://github.com/bestnite/bilinovel-downloader.git
synced 2025-06-17 06:43:18 +08:00
start
This commit is contained in:
15
utils/clean.go
Normal file
15
utils/clean.go
Normal file
@ -0,0 +1,15 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func CleanDirName(input string) string {
|
||||
re := regexp.MustCompile(`[<>:"/\\|?*\x00-\x1F]`)
|
||||
cleaned := re.ReplaceAllString(input, "_")
|
||||
|
||||
cleaned = strings.TrimSpace(cleaned)
|
||||
|
||||
return cleaned
|
||||
}
|
Reference in New Issue
Block a user