Documentation ¶
Index ¶
- func AppendIfMissing(str string, suffix string, suffixes ...string) string
- func AppendIfMissingIgnoreCase(str string, suffix string, suffixes ...string) string
- func AsList(a ...string) []string
- func AsListDouble(a ...float64) []float64
- func AsListInt(a ...int) []int
- func AsListLong(a ...int64) []int64
- func CheckError(err error)
- func Chomp(str string) string
- func Contains(str string, search string) bool
- func ContainsAny(str string, search ...string) bool
- func ContainsAnyCharacter(str string, search string) bool
- func ContainsIgnoreCase(str string, search string) bool
- func ContainsNone(str string, search ...string) bool
- func ContainsNoneCharacter(str string, search string) bool
- func ContainsOnly(str string, search ...string) bool
- func DefaultIfBlank(str string, defaultStr string) string
- func DefaultIfEmpty(str string, defaultStr string) string
- func EndsWith(str string, suffix string) bool
- func EndsWithAny(str string, suffixes ...string) bool
- func EndsWithAnyIgnoreCase(str string, suffixes ...string) bool
- func EndsWithIgnoreCase(str string, suffix string) bool
- func Find[T cmp.Ordered](list []T, value T) int
- func FindAll[T cmp.Ordered](list []T, value T) []int
- func FindLast[T cmp.Ordered](list []T, value T) int
- func FormatDouble[T DecimalNumber](f T) string
- func FormatInt[T IntegerNumber](i T) string
- func Frequencies[T cmp.Ordered](list []T, sortKeys bool) (map[T]int, []T)
- func GCD[T IntegerNumber](a, b T) T
- func IsAllLowerCase(str string) bool
- func IsAllUpperCase(str string) bool
- func IsAlpha(str string) bool
- func IsAlphaSpace(str string) bool
- func IsAlphanumeric(str string) bool
- func IsAlphanumericSpace(str string) bool
- func IsAnyBlank(strings ...string) bool
- func IsAnyEmpty(strings ...string) bool
- func IsBlank(s string) bool
- func IsEmpty(s string) bool
- func IsNoneBlank(strings ...string) bool
- func IsNoneEmpty(strings ...string) bool
- func IsNotBlank(s string) bool
- func IsNotEmpty(s string) bool
- func IsNumeric(str string) bool
- func IsNumericSpace(str string) bool
- func IsWhitespace(str string) bool
- func LCM[T IntegerNumber](a, b T) T
- func Left(str string, size int) string
- func LowerCase(str string) string
- func MaxDouble(list []float64) (float64, int)
- func MaxInt(list []int) (int, int)
- func MaxLong(list []int64) (int64, int)
- func Mid(str string, pos int, size int) string
- func MinDouble(list []float64) (float64, int)
- func MinInt(list []int) (int, int)
- func MinLong(list []int64) (int64, int)
- func Overlay(str string, overlay string, start int, end int) string
- func ParseDouble(s string) float64
- func ParseInt(s string) int
- func ParseLong(s string) int64
- func PrependIfMissing(str string, prefix string, prefixes ...string) string
- func PrependIfMissingIgnoreCase(str string, prefix string, prefixes ...string) string
- func ReadFile(filePath string) string
- func Remove(str string, remove string) string
- func RemoveEnd(str string, remove string) string
- func RemoveEndIgnoreCase(str string, remove string) string
- func RemovePattern(str string, pattern string) string
- func RemoveStart(str string, remove string) string
- func RemoveStartIgnoreCase(str string, remove string) string
- func Repeat(str string, repeat int) string
- func RepeatWithSeparator(str string, sep string, repeat int) string
- func Reverse(s string) string
- func ReverseDelimited(str string, del string) string
- func Right(str string, size int) string
- func RunAdventOfCodeWithFile(funcToRun func([]string), filePath string)
- func RunAdventOfCodeWithString(funcToRun func([]string), stringInput string)
- func RunHackerRank(funcToRun func([]string, *bufio.Writer))
- func RunWithFile(funcToRun func([]string, *bufio.Writer), filePath string)
- func RunWithString(funcToRun func([]string, *bufio.Writer), stringInput string)
- func Split(line string, separator string) []string
- func SplitDoubles(line string, separator string) []float64
- func SplitGetAt(line string, separator string, index int) string
- func SplitGetDoubleAt(line string, separator string, index int) float64
- func SplitGetIntAt(line string, separator string, index int) int
- func SplitGetLongAt(line string, separator string, index int) int64
- func SplitInts(line string, separator string) []int
- func SplitLongs(line string, separator string) []int64
- func StartsWith(str string, prefix string) bool
- func StartsWithAny(str string, prefixes ...string) bool
- func StartsWithAnyIgnoreCase(str string, prefixes ...string) bool
- func StartsWithIgnoreCase(str string, prefix string) bool
- func Strip(str string) string
- func StripEnd(str string) string
- func StripStart(str string) string
- func SubstringAfter(str string, sep string) string
- func SubstringAfterLast(str string, sep string) string
- func SubstringBefore(str string, sep string) string
- func SubstringBeforeLast(str string, sep string) string
- func Trim(str string) string
- func UpperCase(str string) string
- type DecimalNumber
- type IntegerNumber
- type MNode
- type Matrix
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendIfMissing ¶ added in v1.2.0
AppendIfMissing appends a suffix to a string if missing.
func AppendIfMissingIgnoreCase ¶ added in v1.2.0
AppendIfMissingIgnoreCase appends a suffix to a string if missing (ignoring case).
func AsListDouble ¶ added in v1.3.0
func AsListLong ¶ added in v1.3.0
func CheckError ¶
func CheckError(err error)
func Chomp ¶ added in v1.2.0
Chomp removes one newline from end of a string if it's there, otherwise leave it alone. A newline is "\n", "\r", or "\r\n".
func ContainsAny ¶ added in v1.2.0
ContainsAny checks if the string contains any of the string in the given array.
func ContainsAnyCharacter ¶ added in v1.2.0
ContainsAnyCharacter checks if the string contains any of the character in the given string.
func ContainsIgnoreCase ¶ added in v1.2.0
ContainsIgnoreCase checks if the string contains the searched string ignoring case.
func ContainsNone ¶ added in v1.2.0
ContainsNone checks if the string contains no occurrence of searched string.
func ContainsNoneCharacter ¶ added in v1.2.0
ContainsNoneCharacter checks if the string contains no occurrence of searched string.
func ContainsOnly ¶ added in v1.2.0
ContainsOnly checks if a string contains only some strings.
func DefaultIfBlank ¶ added in v1.2.0
DefaultIfBlank returns either the passed in String, or if the String is Blank, the value of defaultStr.
func DefaultIfEmpty ¶ added in v1.2.0
DefaultIfEmpty returns either the passed in String, or if the String is Empty, the value of defaultStr.
func EndsWithAny ¶ added in v1.2.0
EndsWithAny check if a string ends with any of an array of specified strings.
func EndsWithAnyIgnoreCase ¶ added in v1.2.0
EndsWithAnyIgnoreCase check if a string ends with any of an array of specified strings (ignoring case).
func EndsWithIgnoreCase ¶ added in v1.2.0
EndsWithIgnoreCase case in sensitive check if a string ends with a specified suffix.
func FormatDouble ¶ added in v1.0.5
func FormatDouble[T DecimalNumber](f T) string
func FormatInt ¶ added in v1.0.5
func FormatInt[T IntegerNumber](i T) string
func Frequencies ¶ added in v1.0.9
func GCD ¶ added in v1.2.0
func GCD[T IntegerNumber](a, b T) T
func IsAllLowerCase ¶ added in v1.2.0
IsAllLowerCase checks if the string contains only lowercase characters.
func IsAllUpperCase ¶ added in v1.2.0
IsAllUpperCase checks if the string contains only uppercase characters.
func IsAlphaSpace ¶ added in v1.2.0
IsAlphaSpace checks if the string contains only Unicode letters and spaces.
func IsAlphanumeric ¶ added in v1.2.0
IsAlphanumeric checks if the string contains only Unicode letters and digits.
func IsAlphanumericSpace ¶ added in v1.2.0
IsAlphanumericSpace checks if the string contains only Unicode letters, digits and spaces.
func IsAnyBlank ¶ added in v1.2.0
IsAnyBlank checks if any one of the strings are empty or containing only whitespaces.
func IsAnyEmpty ¶ added in v1.2.0
IsAnyEmpty checks if any one of the given strings are empty.
func IsNoneBlank ¶ added in v1.2.0
IsNoneBlank checks if none of the strings are empty or containing only whitespaces.
func IsNoneEmpty ¶ added in v1.2.0
IsNoneEmpty checks if none of the strings are empty.
func IsNotBlank ¶ added in v1.2.0
IsNotBlank checks if a string is not empty or containing only whitespaces.
func IsNotEmpty ¶ added in v1.2.0
IsNotEmpty checks if a string is not empty.
func IsNumericSpace ¶ added in v1.2.0
IsNumericSpace checks if the string contains only digits and whitespace.
func IsWhitespace ¶ added in v1.2.0
IsWhitespace checks if the string contains only whitespace.
func LCM ¶ added in v1.2.0
func LCM[T IntegerNumber](a, b T) T
func ParseDouble ¶
func PrependIfMissing ¶ added in v1.2.0
PrependIfMissing prepends the prefix to the start of the string if the string does not already start with any of the prefixes.
func PrependIfMissingIgnoreCase ¶ added in v1.2.0
PrependIfMissingIgnoreCase prepends the prefix to the start of the string if the string does not already start, case-in sensitive, with any of the prefixes.
func Remove ¶ added in v1.2.0
Remove removes all occurrences of a substring from within the source string.
func RemoveEnd ¶ added in v1.2.0
RemoveEnd removes a substring only if it is at the end of a source string, otherwise returns the source string.
func RemoveEndIgnoreCase ¶ added in v1.2.0
RemoveEndIgnoreCase is the case in sensitive removal of a substring if it is at the end of a source string, otherwise returns the source string.
func RemovePattern ¶ added in v1.2.0
RemovePattern removes each substring of the source string that matches the given regular expression
func RemoveStart ¶ added in v1.2.0
RemoveStart removes a substring only if it is at the beginning of a source string, otherwise returns the source string
func RemoveStartIgnoreCase ¶ added in v1.2.0
RemoveStartIgnoreCase is the case in sensitive removal of a substring if it is at the beginning of a source string, otherwise returns the source string.
func RepeatWithSeparator ¶ added in v1.2.0
RepeatWithSeparator repeats a string `repeat` times to form a new String, with a string separator injected each time.
func ReverseDelimited ¶ added in v1.2.0
ReverseDelimited reverses a string separated by a delimiter.
func RunAdventOfCodeWithFile ¶ added in v1.0.6
func RunAdventOfCodeWithString ¶ added in v1.0.6
func RunHackerRank ¶ added in v1.0.2
func RunWithFile ¶ added in v1.0.2
func RunWithString ¶ added in v1.0.2
func SplitDoubles ¶
func SplitGetDoubleAt ¶ added in v1.2.0
func SplitGetIntAt ¶ added in v1.2.0
func SplitGetLongAt ¶ added in v1.2.0
func SplitLongs ¶
func StartsWith ¶ added in v1.2.0
StartsWith check if a string starts with a specified prefix.
func StartsWithAny ¶ added in v1.2.0
StartsWithAny check if a string starts with any of an array of specified strings.
func StartsWithAnyIgnoreCase ¶ added in v1.2.0
StartsWithAnyIgnoreCase check if a string starts with any of an array of specified strings (ignoring case).
func StartsWithIgnoreCase ¶ added in v1.2.0
StartsWithIgnoreCase case in sensitive check if a string starts with a specified prefix.
func StripStart ¶ added in v1.2.0
StripStart strips whitespace from the start of a String.
func SubstringAfter ¶ added in v1.2.0
SubstringAfter gets the substring after the first occurrence of a separator.
func SubstringAfterLast ¶ added in v1.2.0
SubstringAfterLast gets the substring after the last occurrence of a separator.
func SubstringBefore ¶ added in v1.2.0
SubstringBefore gets the substring before the first occurrence of a separator.
func SubstringBeforeLast ¶ added in v1.2.0
SubstringBeforeLast gets the substring before the last occurrence of a separator.