stringutils

package
v0.0.49 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: MIT Imports: 10 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPalindrome added in v0.0.19

func CheckPalindrome(str string) bool

CheckPalindrome is delegated to verify if the given string is palindrome

func CheckPresence

func CheckPresence(array []string, target string) bool

CheckPresence verify that the given array contains the target string

func ContainsLetter

func ContainsLetter(str string) bool

ContainsLetter verity that the given string contains, at least, an ASCII alphabet characters Note: whitespace is allowed

func ContainsMultiple added in v0.0.28

func ContainsMultiple(lower bool, s string, substring ...string) bool

ContainsMultiple is delegated to verify if the given string 's' contains all the 'substring' present

func ContainsOnlyLetter added in v0.0.12

func ContainsOnlyLetter(str string) bool

ContainsOnlyLetter verity that the given string contains, only, ASCII alphabet characters Note, whitespace is allowed

func CountLines

func CountLines(str string) int

CountLines return the number of lines in the given string

func CreateJSON

func CreateJSON(values []string) string

CreateJSON is delegated to create a simple json object for the key pair in input

func DiceCoefficient added in v0.0.22

func DiceCoefficient(string1, string2 string) float64

DiceCoefficient is bigram position dependent implementation of the Dice coefficient

func ExtractString

func ExtractString(data *string, first, last string) string

ExtractString is delegated to filter the content of the given data delimited by 'first' and 'last' string

func ExtractTextFromQuery

func ExtractTextFromQuery(target string, ignore []string) []string

ExtractTextFromQuery is delegated to retrieve the list of word involved in the query. It can be viewed as a tokenzier that use whitespace for delimit the word

func GetFirstRune added in v0.0.41

func GetFirstRune(data string) rune

func IsASCII

func IsASCII(s string) bool

IsASCII is delegated to verify if a given string is ASCII compliant

func IsASCIIRune added in v0.0.4

func IsASCIIRune(r rune) bool

IsASCIIRune is delegated to verify if the given character is ASCII compliant

func IsBlank added in v0.0.6

func IsBlank(str string) bool

IsBlank is delegated to verify that the does not contains only empty char

func IsLower added in v0.0.2

func IsLower(str string) bool

IsLower verify that a string does contains only lower character

func IsUpper

func IsUpper(str string) bool

IsUpper verify that a string does contains only upper character

func JaroDistance added in v0.0.22

func JaroDistance(str1, str2 string) float64

JaroDistance is delegated to calculate the Jaro distance from the two given string

func Join

func Join(strs ...string) string

Join is a quite efficient string concatenator

func JoinSeparator added in v0.0.28

func JoinSeparator(sep string, strs ...string) string

Join is a quite efficient string concatenator

func LevenshteinDistance added in v0.0.22

func LevenshteinDistance(str1, str2 string) int

LevenshteinDistance is an optimized version for calculate the levenstein distance

func LevenshteinDistanceLegacy added in v0.0.22

func LevenshteinDistanceLegacy(str1, str2 string) int

LevenshteinDistanceLegacy is delegated to calculate the Levenshtein distance for the given string

func RandomString added in v0.0.6

func RandomString(n int) string

RandomString is delegated to create a random string with whitespace included as fast as possible

func RemoveDoubleWhiteSpace added in v0.0.19

func RemoveDoubleWhiteSpace(str string) string

RemoveDoubleWhiteSpace is delegated to remove the whitespace from the given string FIXME: memory inefficient, use 2n size, use RemoveFromString method instead

func RemoveFromString

func RemoveFromString(data string, i int) string

RemoveFromString Remove a given character in position i from the input string

func RemoveNonASCII added in v0.0.5

func RemoveNonASCII(str string) string

RemoveNonASCII is delegated to clean the text from the NON ASCII character

func RemoveWhiteSpace added in v0.0.19

func RemoveWhiteSpace(str string) string

RemoveWhiteSpace is delegated to remove the whitespace from the given string FIXME: memory inefficient, use 2n size, use RemoveFromString method instead

func ReplaceAtIndex added in v0.0.3

func ReplaceAtIndex(str, replacement string, index int) string

ReplaceAtIndex is delegated to replace the character related to the index with the input rune

func ReverseString added in v0.0.19

func ReverseString(str string) string

ReverseString is delegated to return the reverse of the input string

func Split

func Split(data string) []string

Split is delegated to split the string by the new line

func Trim added in v0.0.6

func Trim(str string) string

Trim is delegated to remove the initial, final whitespace and the double whitespace present in the data It also convert every new line in a space

Types

This section is empty.

Jump to

Keyboard shortcuts

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