Skip to content

stringutils Build Status Go Report Card Coverage Status

Package stringutils provides useful string operations.

Details

  • Contains: checks if slice contains a string.
  • ContainsAnySubstring: checks if string contains any of provided substring.
  • DeDup: removes duplicates from slice of strings, optimized for performance, good for short slices only.
  • DeDupBig: removes duplicates from slice. Should be used instead of DeDup for large slices.
  • SliceToString: converts slice of any to a slice of strings.
  • HasCommonElement: checks if any element of the second slice is in the first slice.

Install and update

go get -u github.com/go-pkgz/stringutils