Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "strings"
- )
- const emailList = "bob@gmail.com tom@gmail.com bob@gmail.com"
- func main() {
- // create a new slice by calling the Fields function
- emails := strings.Fields(emailList)
- // loop over the slice and print out the words
- for _, email := range emails {
- fmt.Println(email)
- }
- }
Add Comment
Please, Sign In to add comment