Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleAppendRune (0.31 sec)

  1. src/unicode/utf8/example_test.go

    	valid := "Hello, ไธ–็•Œ"
    	invalid := string([]byte{0xff, 0xfe, 0xfd})
    
    	fmt.Println(utf8.ValidString(valid))
    	fmt.Println(utf8.ValidString(invalid))
    	// Output:
    	// true
    	// false
    }
    
    func ExampleAppendRune() {
    	buf1 := utf8.AppendRune(nil, 0x10000)
    	buf2 := utf8.AppendRune([]byte("init"), 0x10000)
    	fmt.Println(string(buf1))
    	fmt.Println(string(buf2))
    	// Output:
    	// ๐€€
    	// init๐€€
    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