Skip to content

0.7.1 – String iterators

Compare
Choose a tag to compare
@liquidev liquidev released this 29 Jan 14:22

This release introduces string iterators into the API.

  • String.bytes/0 - iterates over individual bytes in a string (yields Number)
  • String.chars/0 - iterates over Unicode codepoints in a string (yields String)
  • String.code_points/0 - same as String.chars/0, but yields Number
  • String.lines/0 - iterates over LF or CRLF separated lines in the string (yields String)
  • String.split/1 - splits the string into substrings using a separator, going from the left (yields String)
  • String.rsplit/1 - splits the string into substrings using a separator, going from the right (yields String)