Golang String huruf besar
// Go program to illustrate how to convert
// the given string into uppercase
package main
import (
"fmt"
"strings"
)
// Main method
func main() {
// Creating and initializing string
// Using shorthand declaration
str1 := "WelcomE, GeeksforGeeks**"
str2 := "$$This is the, tuTorial oF Golang##"
str3 := "HELLO! GOLANG"
str4 := "uppercase conversion"
// Displaying strings
fmt.Println("Strings (before):")
fmt.Println("String 1: ", str1)
fmt.Println("String 2:", str2)
fmt.Println("String 3:", str3)
fmt.Println("String 4:", str4)
// Converting all the string into uppercase
// Using ToUpper() function
res1 := strings.ToUpper(str1)
res2 := strings.ToUpper(str2)
res3 := strings.ToUpper(str3)
res4 := strings.ToUpper(str4)
// Displaying the results
fmt.Println("\nStrings (after):")
fmt.Println("Result 1: ", res1)
fmt.Println("Result 2:", res2)
fmt.Println("Result 3:", res3)
fmt.Println("Result 4:", res4)
}
Thankful Tapir