- Code: Select all
"should wOrk for sample tesT cases"
"All the rules in this world wEre made by someone no smaRter than you. So make your own."
"Dying is mainstream"
Board index › Программирование › Задачник
"should wOrk for sample tesT cases"
"All the rules in this world wEre made by someone no smaRter than you. So make your own."
"Dying is mainstream"
package main
import (
"fmt"
"strings"
)
func main() {
fmt.Println(ToJadenCase("should wOrk for sample test cases"))
}
func ToJadenCase(str string) string {
var newSl []string
sl := strings.Split(str, " ")
for _, str := range sl {
newSl = append(newSl, strings.ToUpper(string(str[0]))+strings.ToLower(str[1:]))
}
return strings.Join(newSl, " ")
}