mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 05:11:49 +08:00
04.4.1.md
This commit is contained in:
18
eBook/examples/chapter_4/toupper_lower.go
Normal file
18
eBook/examples/chapter_4/toupper_lower.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var orig string = "Hey, how are you George?"
|
||||
var lower string
|
||||
var upper string
|
||||
|
||||
fmt.Printf("The original string is: %s\n", orig)
|
||||
lower = strings.ToLower(orig)
|
||||
fmt.Printf("The lowercase string is: %s\n", lower)
|
||||
upper = strings.ToUpper(orig)
|
||||
fmt.Printf("The uppercase string is: %s\n", upper)
|
||||
}
|
Reference in New Issue
Block a user