Skip to content

lpil/splitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

splitter

Efficiently slice prefixes from strings. Good for parsers!

Package Version Hex Docs

gleam add splitter@1
import splitter

pub fn main() -> Nil {
  let line_ends = splitter.new(["\n", "\r\n"])

  splitter.split(line_ends, "1. Bread\n2. Milk\n3. Eggs\n")
  // -> #("1. Bread", "\n", "2. Milk\n3. Eggs\n")

  splitter.split(line_ends, "No end of line here!")
  // -> #("No end of line here!", "", "")
}

Further documentation can be found at https://hexdocs.pm/splitter.

About

Efficiently slice prefixes from strings. Good for parsers!

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •