Contact: aviboots(AT)netvision.net.il
39,885 questions
51,811 answers
573 users
package main import ( "fmt" "strings" ) func main() { s := "go java c c++ go python go" lastSpaceIndex := strings.LastIndex(s, " ") if lastSpaceIndex != -1 { s = s[:lastSpaceIndex] } fmt.Println(s) } /* run: go java c c++ go python */