package main
import (
"fmt"
"strings"
)
func main() {
str := "nilpointer.net"
result := strings.Split(str, ".")
fmt.Println("size:", len(result))
for _, value := range result {
fmt.Println(value)
}
}
Output
size: 2
nilpointer
net