You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
306 B

package main
import (
"fmt"
"os"
"unicode"
)
func main() {
for _, arg := range os.Args[1:] {
arg := []rune(arg)
for j, r := range arg {
if j+1 == len(arg) || arg[j+1] == ' ' {
arg[j] = unicode.ToUpper(r)
} else {
arg[j] = unicode.ToLower(r)
}
}
fmt.Println(string(arg))
}
}