package main

import (
    "fmt"
    "strings"
)

func main() {
    s := "foo bar baz"
    for i, part := range strings.SplitN(s, " ", 1) {
        fmt.Println(i, part)
    }
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: