stringsi

package
v0.0.0-...-1f4ee57 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Match provides a simple pattern matcher with unicode support.

Index

Constants

This section is empty.

Variables

View Source
var HanPunctuation = []rune{
	'\u3002', '\uff1b', '\uff0c', '\uff1a', '\u201c', '\u201d', '\uff08', '\uff09', '\u3001', '\uff1f', '\u300a', '\u300b',
}

[。;,:“”()、?《》]

Functions

func Allowable

func Allowable(pattern string) (min, max string)

Allowable parses the pattern and determines the minimum and maximum allowable values that the pattern can represent. When the max cannot be determined, 'true' will be returned for infinite.

func AnchorName

func AnchorName(text string) string

Create returns a sanitized anchor name for the given text.

func Camel

func Camel(s string) string

func ConvertToCamelCase

func ConvertToCamelCase(in string) string

func ConvertToSnackCase

func ConvertToSnackCase(in string) string

func FormatLen

func FormatLen(s string, length int) string

func HasHan

func HasHan(s string) bool

func HasPrefixes

func HasPrefixes(s string, prefixes []string) bool

有一个匹配成功就返回true

func In

func In(s string, ss []string) bool

func IsASCIIDigit

func IsASCIIDigit(c byte) bool

Is c an ASCII digit?

func IsASCIILower

func IsASCIILower(c byte) bool

Is c an ASCII lower-case letter?

func IsPattern

func IsPattern(str string) bool

IsPattern returns true if the string is a pattern.

func LowerCase

func LowerCase(c byte) byte

func LowerFirst

func LowerFirst(t string) string

仅首位小写(更符合接口的规范)

func Match

func Match(str, pattern string) bool

pattern:

{ term }

term:

'*'         matches any sequence of non-Separator characters
'?'         matches any single non-Separator character
c           matches character c (c != '*', '?', '\\')
'\\' c      matches character c

func QuoteToBytes

func QuoteToBytes(s string) []byte

func ReplaceRuneEmpty

func ReplaceRuneEmpty(s string, old []rune) string

func ToBytes

func ToBytes(s string) []byte

func ToString

func ToString(b []byte) string

func UpperCase

func UpperCase(c byte) byte

Types

This section is empty.

Directories

Path Synopsis
Match provides a simple pattern matcher with unicode support.
Match provides a simple pattern matcher with unicode support.

Jump to

Keyboard shortcuts

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