The ToUpper() Function is used to convert all the characters/letters of the String in upper case.
package main import "fmt" import "strings" func main() { x := "HeLLo" y := strings.ToUpper(x) fmt.Println("The String in upper case is :",y) }
In the above code, we have declared a String 'HeLLo', in which the letters 'e' and 'o' are in lower case.
So, we have used the 'ToUpper()' Function to convert them to upper case and assign to a variable 'y'.