- Define a variable with the value of this name/string:
Alexander Supertramp
- Using the variable you defined, print only the first name
- Using the variable you defined, print only the surname
package main
import (
"fmt"
"strings"
)
func main() {
var name string = "Alexander Supertramp"
fmt.Printf("First name: %v\n", strings.Fields(name)[0])
fmt.Printf("Surname: %v", strings.Fields(name)[1])
}