Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleRuneLen (0.26 sec)

  1. src/unicode/utf8/example_test.go

    func ExampleRuneCountInString() {
    	str := "Hello, δΈ–η•Œ"
    	fmt.Println("bytes =", len(str))
    	fmt.Println("runes =", utf8.RuneCountInString(str))
    	// Output:
    	// bytes = 13
    	// runes = 9
    }
    
    func ExampleRuneLen() {
    	fmt.Println(utf8.RuneLen('a'))
    	fmt.Println(utf8.RuneLen('η•Œ'))
    	// Output:
    	// 1
    	// 3
    }
    
    func ExampleRuneStart() {
    	buf := []byte("aη•Œ")
    	fmt.Println(utf8.RuneStart(buf[0]))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 05 21:29:18 UTC 2021
    - 3.6K bytes
    - Viewed (0)
Back to top