package main
import (
"fmt"
"strings"
)
func lengthOfLastWord(str string) int {
words := strings.Fields(str)
return len(words[len(words)-1])
}
func main() {
input := "java c rust javascript golang"
fmt.Println("The length of the last word is:", lengthOfLastWord(input))
}
/*
run:
The length of the last word is: 6
*/