Documentation ¶
Overview ¶
*Copyright (c) 2022, kaydxh * *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal *in the Software without restriction, including without limitation the rights *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *copies of the Software, and to permit persons to whom the Software is *furnished to do so, subject to the following conditions: * *The above copyright notice and this permission notice shall be included in all *copies or substantial portions of the Software. * *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *SOFTWARE.
*Copyright (c) 2022, kaydxh * *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal *in the Software without restriction, including without limitation the rights *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *copies of the Software, and to permit persons to whom the Software is *furnished to do so, subject to the following conditions: * *The above copyright notice and this permission notice shall be included in all *copies or substantial portions of the Software. * *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *SOFTWARE.
Index ¶
- func EqualCaseInsensitive(src, dst string) bool
- func GetStringOrFallback(values ...string) string
- func RemoveEmpty(s []string) []string
- func Replace(s string, old string, news []interface{}, useQuote bool, n int) string
- func ReplaceAll(s, old string, news []interface{}, useQuote bool) string
- func SliceContains(list []string, target string, caseSensitive bool) bool
- func SliceContainsCaseInSensitive(list []string, target string) bool
- func SliceDifference(s1 []string, s2 []string) []string
- func SliceIntersection(s1 []string, s2 []string) []string
- func SliceUnique(s ...string) []string
- func SliceWithCondition(s1 []string, cond func(s2 string) bool) []string
- func Split2(s, sep string) (string, string, bool)
- func SplitOmitEmpty(s, sep string) []string
- func SplitToNums[T any](s, sep string, convert func(string) (T, error)) ([]T, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EqualCaseInsensitive ¶ added in v0.0.117
func GetStringOrFallback ¶
func RemoveEmpty ¶ added in v0.0.52
func ReplaceAll ¶ added in v0.0.53
func SliceContains ¶ added in v0.0.61
func SliceContainsCaseInSensitive ¶ added in v0.0.75
sliceContains reports whether the provided string is present in the given slice of strings.
func SliceDifference ¶ added in v0.0.91
func SliceIntersection ¶ added in v0.0.29
func SliceUnique ¶ added in v0.0.29
func SliceWithCondition ¶ added in v0.0.99
func Split2 ¶ added in v0.0.93
Split2 returns the values from strings.SplitN(s, sep, 2). If sep is not found, it returns ("", "", false) instead.
func SplitOmitEmpty ¶ added in v0.0.80
Split slices s into all substrings separated by sep and returns a slice of the substrings between those separators.
If s does not contain sep and sep is not empty, Split returns a slice of length 0.
If sep is empty, Split splits after each UTF-8 sequence. If both s and sep are empty, Split returns an empty slice.
It is equivalent to SplitN with a count of -1.
Types ¶
This section is empty.