123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package main
- import (
- "fmt"
- "unicode/utf8"
- )
- func main() {
-
- var str string
-
- var hello string = "Привет\n\t"
-
- var world string = `Мир\n\t`
- fmt.Println("str", str)
- fmt.Println("hello", hello)
- fmt.Println("world", world)
-
- var helloWorld = "Привет, Мир!"
- hi := "你好,世界"
- fmt.Println("helloWorld", helloWorld)
- fmt.Println("hi", hi)
-
- var rawBinary byte = '\x27'
-
- var someChinese rune = '茶'
- fmt.Println(rawBinary, someChinese)
- helloWorld = "Привет Мир"
-
- andGoodMorning := helloWorld + " и доброе утро!"
- fmt.Println(helloWorld, andGoodMorning)
-
-
-
-
- byteLen := len(helloWorld)
- symbols := utf8.RuneCountInString(helloWorld)
- fmt.Println(byteLen, symbols)
-
- hello = helloWorld[:12]
- H := helloWorld[0]
- fmt.Println(H)
-
- byteString := []byte(helloWorld)
- helloWorld = string(byteString)
- fmt.Println(byteString, helloWorld)
- }
|