GO語言"unicode/utf8"包中"RuneStart"函數的用法及代碼示例。
用法:
func RuneStart(b byte) bool
RuneStart 報告字節是否可能是編碼的第一個字節,可能是無效的符文。第二個和後續字節的前兩位始終設置為 10。
例子:
package main
import (
"fmt"
"unicode/utf8"
)
func main() {
buf := []byte("a界")
fmt.Println(utf8.RuneStart(buf[0]))
fmt.Println(utf8.RuneStart(buf[1]))
fmt.Println(utf8.RuneStart(buf[2]))
}
輸出:
true true false
相關用法
- GO RuneCount用法及代碼示例
- GO RuneLen用法及代碼示例
- GO Runes用法及代碼示例
- GO RuneCountInString用法及代碼示例
- GO Regexp.FindString用法及代碼示例
- GO Regexp.FindAllIndex用法及代碼示例
- GO ResponseRecorder用法及代碼示例
- GO ReverseBytes64用法及代碼示例
- GO ReverseBytes16用法及代碼示例
- GO Regexp.ReplaceAllLiteralString用法及代碼示例
- GO Regexp.FindStringSubmatch用法及代碼示例
- GO Rows用法及代碼示例
- GO Regexp.FindAllString用法及代碼示例
- GO ReadMessage用法及代碼示例
- GO Regexp.ExpandString用法及代碼示例
- GO ResponseWriter用法及代碼示例
- GO Regexp.FindAllStringSubmatch用法及代碼示例
- GO Reverse用法及代碼示例
- GO Read用法及代碼示例
- GO RotateLeft32用法及代碼示例
注:本文由純淨天空篩選整理自golang.google.cn大神的英文原創作品 RuneStart。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。