str

package
v0.0.0-...-9b92ec5 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sort

func Sort(in string) string

Types

type Sequence

type Sequence struct {
	// contains filtered or unexported fields
}

Sequence 用于查询该字符串是否存在目录子串 注意: 只实现全小写字母匹配

原理: 创建一个字符串长度二维数组,倒序遍历字符串,当前字符出现 则当前位置设置为字符串索引,其它位置设置为下一层的值

使用: seq := New("ahbgdc")

true == seq.HasSubsequence("abc")

func NewSequence

func NewSequence(str string) *Sequence

NewSequence 创建匹配对象

func (*Sequence) HasSubsequence

func (th *Sequence) HasSubsequence(target string) bool

HasSubsequence 是否包含子串 target

Jump to

Keyboard shortcuts

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