In a group chat, @name calls someone. Write Mentions(msg) to return the mentioned names in order, without the @. Words are separated by exactly one space; if nobody is mentioned, or the message is empty, return an empty slice.
Mentions("hi @ana and @ben")→['ana', 'ben']Mentions("no one here")→[]func Mentions(msg string) []stringpackage main
import "strings"
func Mentions(msg string) []string {
names := []string{}
// your code here: split msg at spaces; for words starting with @, append the name after it to names
return names
}
Run tries the examples. When they look right, Submit.