Splitting compound words

Report a typo

Below you will see a slice of strings called words that contains five compound words.

Your task is to use slice expressions to create a substring with the second part of every compound word, and then print the substring.

Write a program in Go
package main

import "fmt"

func main() {
words := []string{"saltwater", "backstage", "bedrock", "sandcastle", "snowman"}

w1 := words[0][?]
w2 := words[1][?]
w3 := words[2][?]
w4 := words[3][?]
w5 := words[4][?]

fmt.Println(w1, w2, w3, w4, w5) // DO NOT delete this line, it prints the substrings!
}
___

Create a free account to access the full topic