Files
hiscaler-gox/pathx/path.go
scheibling b4eb50ab55
Some checks failed
Go / build (push) Failing after 7s
Created
2025-04-08 19:16:39 +02:00

19 lines
250 B
Go

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
}