Hi - I’m not able to split a string with “x” as separator. Code below. Could someone explain why the split doesn’t work on the variable “resol”?
https://play.golang.org/p/ROXjl2tdA1n
package main
import (
“fmt”
“path/filepath”
“strings”
)
func main() {
var filename, base, resol, reso string
filename = “SN_FEDERAL_CUP_FTR_1000×560.jpg”
base = strings.TrimSuffix(filename, filepath.Ext(filename))
resol = strings.Split(base, “")[len(strings.Split(base, "”))-1]
reso = “1000x560”
fmt.Println(resol, strings.Split(resol, “x”))
fmt.Println(reso, strings.Split(reso, “x”))
}