udwStrings

package
v0.0.0-...-f254aa5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 11 Imported by: 16

Documentation

Index

Constants

View Source
const (
	OkChar    = "✔"
	ErrorChar = "✘"
)

Variables

This section is empty.

Functions

func AsciiToLower

func AsciiToLower(str string) string

func AsciiToLowerByteListInPlace

func AsciiToLowerByteListInPlace(str []byte)

func AverageRandomIpSlice

func AverageRandomIpSlice(ipSlice []string, partNum int, perPartCount int) (result []string)

func ByteListIndexAll

func ByteListIndexAll(b []byte, keyword []byte) (outList []int)

func ContainsAnyIgnoreCase

func ContainsAnyIgnoreCase(s string, subList []string) (result map[string]int)

func ContainsAnyInSlice

func ContainsAnyInSlice(toSearch string, KeywordSlice []string) bool

func ContainsIgnoreCase

func ContainsIgnoreCase(s string, sub string) (ok bool)

func Fields

func Fields(s string) []string

func FirstLetterToUpper

func FirstLetterToUpper(s string) string

func GetByteArrayFromStringNoAlloc

func GetByteArrayFromStringNoAlloc(s string) []byte

func GetCountByteNumber

func GetCountByteNumber(s string, b byte) int

func GetIntersection

func GetIntersection(lists ...[]string) []string

func GetIntersectionV2

func GetIntersectionV2(lists ...[]string) []string

func GetIntersectionV3

func GetIntersectionV3(lists ...[]string) []string

func GetIntersectionV4

func GetIntersectionV4(lists ...[]string) []string

func GetMonospaceWidth

func GetMonospaceWidth(str string) int

func GetShareCommonPrefix

func GetShareCommonPrefix(s1 string, s2 string) string

func GetSmallestBiggerStringPrefix

func GetSmallestBiggerStringPrefix(prefix string) string

func GetSpaceArrayByIndex

func GetSpaceArrayByIndex(s string, index int) string

func GetStringFromByteArrayNoAlloc

func GetStringFromByteArrayNoAlloc(b []byte) string

func IsAllAlphabet

func IsAllAlphabet(s string) bool

func IsAllAlphabetNum

func IsAllAlphabetNum(s string) bool

func IsAllAscii

func IsAllAscii(s string) bool

func IsAllDecodeByUtf8

func IsAllDecodeByUtf8(p []byte) bool

func IsAllDecodeByUtf8String

func IsAllDecodeByUtf8String(p string) bool

func IsAllNum

func IsAllNum(s string) bool

func IsAllPrintableUtf8

func IsAllPrintableUtf8(p []byte) bool

func IsEqualCheckOrder

func IsEqualCheckOrder(lists ...[]string) bool

func IsEqualIgnoreOrder

func IsEqualIgnoreOrder(lists ...[]string) bool

func IsGoodFileName

func IsGoodFileName(s string) bool

func IsInKeywordSlice

func IsInKeywordSlice(KeywordSlice []string, toSearch string) bool

func IsInSlice

func IsInSlice(slice []string, s string) bool

func IsInSliceBSearch

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

func IsSafePrintByte

func IsSafePrintByte(s []byte) bool

func LastTwoPartSplit

func LastTwoPartSplit(originS string, splitS string) (p1 string, p2 string, ok bool)

func LineDataToSlice

func LineDataToSlice(lineData string) []string

func MapStringBoolToSortedSlice

func MapStringBoolToSortedSlice(m map[string]bool) []string

func MergeNoRepeat

func MergeNoRepeat(lists ...[]string) []string

func MustStringBetweenFirstSubString

func MustStringBetweenFirstSubString(s string, sub1 string, sub2 string) string

func NewRootPrefixNode

func NewRootPrefixNode() *prefixNode

func Padding

func Padding(s string, expectTotalSize int) string

func ReadFirstStringBetweenWithByteList

func ReadFirstStringBetweenWithByteList(content []byte, startPart []byte, endPart []byte) []byte

func RemoveWhiteSpace

func RemoveWhiteSpace(in string) string

func SliceNoRepeat

func SliceNoRepeat(slice []string) []string

func SliceNoRepeatAdd

func SliceNoRepeatAdd(slice []string, s string) []string

func SliceNoRepeatMerge

func SliceNoRepeatMerge(s1 []string, s2 []string) []string

func SliceRemove

func SliceRemove(slice []string, s string) []string

func SplitLine

func SplitLine(s string) []string

func SplitLineNoEmptyLine

func SplitLineNoEmptyLine(s string) []string

func SplitLineTrimSpace

func SplitLineTrimSpace(s string) []string

func SplitTrimSpace

func SplitTrimSpace(s string, sep string) []string

func StringAfterFirstSubString

func StringAfterFirstSubString(s string, subString string) string

func StringAfterLastSubString

func StringAfterLastSubString(s string, subString string) string

func StringBeforeFirstSubString

func StringBeforeFirstSubString(s string, subString string) string

func StringBeforeFirstSubStringOrInput

func StringBeforeFirstSubStringOrInput(s string, subString string) string

func StringBeforeLastSubString

func StringBeforeLastSubString(s string, subString string) string

func StringBetweenFirstSubStringIgnoreNotExist

func StringBetweenFirstSubStringIgnoreNotExist(s string, sub1 string, sub2 string) string

func StringFieldsAtPos

func StringFieldsAtPos(s string, pos int) string

func StringSliceAverageSplit

func StringSliceAverageSplit(slice []string, partNum int) (subSlice [][]string)

func StringSliceClone

func StringSliceClone(s []string) []string

func StringSliceExcept

func StringSliceExcept(inList []string, exceptList []string) []string

func StringSliceLastIndex

func StringSliceLastIndex(slice []string, search string) (pos int)

func StringSliceMerge

func StringSliceMerge(objList ...interface{}) []string

func StringSplitToTwoPart

func StringSplitToTwoPart(s string, sep string) (string, string)

func SubStr

func SubStr(s string, from int, to int) string

func TrimAllLineSpaceInPrefix

func TrimAllLineSpaceInPrefix(s string) string

func TrimMaxSize

func TrimMaxSize(s string, maxSize int) string

func TrimMaxSizeByte

func TrimMaxSizeByte(s string, maxSize int) string

func TrimMaxSizeWithSubfix

func TrimMaxSizeWithSubfix(s string, maxSize int, subfix string) string

func TrimOneChar

func TrimOneChar(s string, c byte) string

Types

type LineSpliter

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

func NewLineSpliter

func NewLineSpliter(content string) *LineSpliter

func (*LineSpliter) GetLineContent

func (ls *LineSpliter) GetLineContent(lineNumber int) string

func (*LineSpliter) GetLineNumByPos

func (ls *LineSpliter) GetLineNumByPos(pos int) int

func (*LineSpliter) GetTotalLineNumber

func (ls *LineSpliter) GetTotalLineNumber() int

type RangeMinMax

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

func (*RangeMinMax) AddMaxKeyInclude

func (kr *RangeMinMax) AddMaxKeyInclude(maxKey string)

func (*RangeMinMax) AddMaxKeyNotInclude

func (kr *RangeMinMax) AddMaxKeyNotInclude(maxKeyNotInclude string)

func (*RangeMinMax) AddMinKeyInclude

func (kr *RangeMinMax) AddMinKeyInclude(minKey string)

func (*RangeMinMax) AddMinKeyNotInclude

func (kr *RangeMinMax) AddMinKeyNotInclude(minKeyNotInclude string)

func (*RangeMinMax) AddPrefix

func (kr *RangeMinMax) AddPrefix(prefix string)

func (*RangeMinMax) GetMaxKeyNotInclude

func (kr *RangeMinMax) GetMaxKeyNotInclude() string

func (*RangeMinMax) GetMinKeyInclude

func (kr *RangeMinMax) GetMinKeyInclude() string

func (*RangeMinMax) HasRange

func (kr *RangeMinMax) HasRange() bool

func (*RangeMinMax) IsInRange

func (kr *RangeMinMax) IsInRange(s string) bool

func (*RangeMinMax) ToMinKeyIncludeAndMaxKeyNotIncludeRange

func (kr *RangeMinMax) ToMinKeyIncludeAndMaxKeyNotIncludeRange() RangeMinMax

type SliceExistChecker

type SliceExistChecker map[string]bool

func NewSliceExistChecker

func NewSliceExistChecker(slice ...string) SliceExistChecker

func (SliceExistChecker) Add

func (c SliceExistChecker) Add(s string) bool

func (SliceExistChecker) FindNotExistOne

func (c SliceExistChecker) FindNotExistOne() (NotExist string)

Jump to

Keyboard shortcuts

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