An open API service indexing awesome lists of open source software.

https://github.com/lpil/splitter

Efficiently slice prefixes from strings. Good for parsers!
https://github.com/lpil/splitter

Last synced: 4 months ago
JSON representation

Efficiently slice prefixes from strings. Good for parsers!

Awesome Lists containing this project

README

          

# splitter

Efficiently slice prefixes from strings. Good for parsers!

[![Package Version](https://img.shields.io/hexpm/v/splitter)](https://hex.pm/packages/splitter)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/splitter/)

```sh
gleam add splitter@1
```
```gleam
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 .