Help in splitting string with "x" as separator

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”))
}

"1000×560" != "1000x560". The first one has a unicode multiplication sign (U+00D7).

Thank you Sean. Code works now.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.