Files
hiscaler-gox/pathx/path.go

19 lines
250 B
Go
Raw Permalink Normal View History

2025-04-08 19:16:39 +02:00
package pathx
import (
"path"
"strings"
)
func FilenameWithoutExt(s string) string {
if s == "" {
return ""
}
filename := path.Base(s)
if ext := path.Ext(s); ext != "" {
filename = strings.TrimSuffix(filename, ext)
}
return filename
}