1. func main() {
    2. s := '196:廊坊市-199:固安县'
    3. fmt.Print(splitStringChar(s))
    4. }
    5. func splitString(r rune) bool {
    6. return r == ':' || r == '-'
    7. }
    8. func splitStringChar(s string) []string {
    9. a := strings.FieldsFunc(s, splitString)
    10. return a
    11. }