切割文件名
func main() {
filestr := "file.log"
fileSp := strings.Split(filestr, ".")[0]
fmt.Printf(fileSp)
}
out
file
如果strings.Split(filestr, ".")[0],索引换成1,输出的就是log
标签:filestr,切割,文件名,Split,file,fileSp From: https://www.cnblogs.com/sunnybowen/p/16644665.html