Application
Create new folder named src. In src folder, create new file named main.go as below:
package main
import (
"fmt"
"strings"
)
func main() {
s := "p01,name 1,4.5,20"
result := strings.Split(s, ",")
for _, value := range result {
fmt.Println(value)
}
}
Output
Open Terminal windows in Visual Studio Code and run command line: go run main.go
p01
name 1
4.5
20