In Go, there are a number of methods to make a string
UpperCase, every of them are by utilizing the strings
bundle.
Possibility 1 (strings.ToUpper
):
func ToUpper(str string) string
bundle principal
import (
"fmt"
"strings"
)
func principal() {
str1 := "This can be a Check"
fmt.Println(strings.ToUpper(str1))
// "THIS IS A TEST"
}
Possibility 2 (strings.ToTitle
):
func ToTitle(str string) string
bundle principal
import (
"fmt"
"strings"
)
func principal() {
str1 := "This can be a Check"
fmt.Println(strings.ToTitle(str1))
// "THIS IS A TEST"
}