goscript-engine 0.1.0

goscript engine
Documentation
package main

import (
	"fmt"
    "unicode/utf8"
)

func ExampleDecodeLastRune() {
	b := []byte("Hello, δΈ–η•Œ")
	utf8.DecodeLastRune(b)

	
	for len(b) > 0 {
		r, size := utf8.DecodeLastRune(b)
		fmt.Println("%c %v\n", r, size)

		b = b[:len(b)-size]
	}
	
	// Output:
	// η•Œ 3
	// δΈ– 3
	//   1
	// , 1
	// o 1
	// l 1
	// l 1
	// e 1
	// H 1
}


func main() {
    ExampleDecodeLastRune()
	fmt.Println(utf8.RuneError, "a \n bπŸ‘Œ")
	s := "\\ \n \\"
	fmt.Println(s[0], len(s), s)
}