unistring

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package unistring 是一个混合ASCII/UTF16字符串的实现 对于 ASCII 字符串,底层处理相当于普通的 Go 字符串 对于 unicode 字符串,底层处理为 []uint16 ,符合 UTF16 的编码规则,第0个元素为0xFEFF

Index

Constants

View Source
const BOM = 0xFEFF

Variables

This section is empty.

Functions

func Scan

func Scan(s string) []uint16

Scan 检查一个字符串是否包含 unicode 字符,如果有,则转换为使用 FromUtf16 创建的字符串,否则返回 nil

Types

type String

type String string

func FromUtf16

func FromUtf16(b []uint16) String

func NewFromRunes

func NewFromRunes(s []rune) String

func NewFromString

func NewFromString(s string) String

func (String) AsUtf16

func (s String) AsUtf16() []uint16

func (String) String

func (s String) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL