Module ggstd::strings

source ·

Structs

  • A Builder is used to efficiently build a string using Write methods. It minimizes memory copying.
  • A Reader implements the std::io::Read trait.

Functions

  • contains reports whether substr is within s.
  • Cut slices s around the first instance of sep, returning the text before and after sep. The found result reports whether sep appears in s. If sep does not appear in s, cut returns s, “”, false.
  • has_suffix tests whether the string s ends with suffix.
  • index returns the index of the first instance of substr in s, or -1 if substr is not present in s.
  • ReplaceAll returns a copy of the string s with all non-overlapping instances of old replaced by new. If old is empty, it matches at the beginning of the string and after each UTF-8 sequence, yielding up to k+1 replacements for a k-rune string.