util

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 License: MulanPSL-2.0 Imports: 7 Imported by: 15

Documentation

Index

Constants

View Source
const Caret = "‸"

Caret 插入符 \u2038。

View Source
const CaretNewline = Caret + "\n"

CaretNewline 插入符加换行。

View Source
const CaretReplacement = "caretreplacement"

CaretReplacement 用于解析过程中临时替换。

View Source
const FrontEndCaret = "<wbr>"

FrontEndCaret 前端插入符。

View Source
const FrontEndCaretSelfClose = "<wbr/>"

FrontEndCaretSelfClose 前端自动闭合插入符。

View Source
const IALValEscNewLine = "_esc_newline_"

Variables

View Source
var CaretNewlineTokens = []byte(CaretNewline)

CaretNewlineTokens 插入符加换行字节数组。

View Source
var CaretRune = []rune(Caret)[0]

CaretRune 是插入符的 Rune。

View Source
var CaretTokens = []byte(Caret)

CaretTokens 是插入符的字节数组。

Functions

func BytesToStr

func BytesToStr(bytes []byte) string

BytesToStr 快速转换 []byte 为 string。

func IsDocIAL

func IsDocIAL(tokens []byte) bool

func IsDocIAL2

func IsDocIAL2(ial [][]string) bool

func PathEscape

func PathEscape(s string) string

PathEscape escapes the string so it can be safely placed inside a URL path segment.

func PathUnescape

func PathUnescape(s string) (string, error)

PathUnescape does the inverse transformation of PathEscape, converting each 3-byte encoded substring of the form "%AB" into the hex-decoded byte 0xAB. It returns an error if any % is not followed by two hexadecimal digits.

PathUnescape is identical to QueryUnescape except that it does not unescape '+' to ' ' (space).

func RecoverPanic

func RecoverPanic(err *error)

RecoverPanic recovers a panic.

func StrToBytes

func StrToBytes(str string) []byte

StrToBytes 快速转换 string 为 []byte。

func WordCount

func WordCount(str string) (runeCount, wordCount int)

Types

type EscapeError

type EscapeError string

func (EscapeError) Error

func (e EscapeError) Error() string

type InvalidHostError

type InvalidHostError string

func (InvalidHostError) Error

func (e InvalidHostError) Error() string

Jump to

Keyboard shortcuts

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