Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleValidRune (0.35 sec)

  1. src/unicode/utf8/example_test.go

    	valid := []byte("Hello, 世界")
    	invalid := []byte{0xff, 0xfe, 0xfd}
    
    	fmt.Println(utf8.Valid(valid))
    	fmt.Println(utf8.Valid(invalid))
    	// Output:
    	// true
    	// false
    }
    
    func ExampleValidRune() {
    	valid := 'a'
    	invalid := rune(0xfffffff)
    
    	fmt.Println(utf8.ValidRune(valid))
    	fmt.Println(utf8.ValidRune(invalid))
    	// Output:
    	// true
    	// false
    }
    
    func ExampleValidString() {
    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