Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleDecodeLastRune (0.2 sec)

  1. src/unicode/utf8/example_test.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package utf8_test
    
    import (
    	"fmt"
    	"unicode/utf8"
    )
    
    func ExampleDecodeLastRune() {
    	b := []byte("Hello, 世界")
    
    	for len(b) > 0 {
    		r, size := utf8.DecodeLastRune(b)
    		fmt.Printf("%c %v\n", r, size)
    
    		b = b[:len(b)-size]
    	}
    	// Output:
    	// 界 3
    	// 世 3
    	//   1
    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