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!
- Host: GitHub
- URL: https://github.com/lpil/splitter
- Owner: lpil
- Created: 2025-03-31T13:50:53.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-10T14:03:09.000Z (6 months ago)
- Last Synced: 2025-11-10T16:06:46.709Z (6 months ago)
- Language: Gleam
- Size: 13.7 KB
- Stars: 18
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# splitter
Efficiently slice prefixes from strings. Good for parsers!
[](https://hex.pm/packages/splitter)
[](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 .