exercices of section 13

This commit is contained in:
2025-02-05 12:17:08 +01:00
parent ec3676ddd4
commit eba1e3ec49
6 changed files with 186 additions and 0 deletions

21
Section13/4.go Normal file
View File

@@ -0,0 +1,21 @@
package main
import (
"fmt"
"unicode/utf8"
)
func main() {
s1 := "Go is cool!"
x := s1[0]
fmt.Println(x)
// ERROR -> cannot assign to s1[0]
// s1[0] = 'x'
// printing the number of runes in the string
// fmt.Println(len(s1))
fmt.Println(utf8.RuneCountInString(s1))
}