https://github.com/guitarbum722/qualified
A simple library to deal with delimited strings that _could_ contain the delimiter in the data itself.
https://github.com/guitarbum722/qualified
delimiter go golang library text
Last synced: about 1 month ago
JSON representation
A simple library to deal with delimited strings that _could_ contain the delimiter in the data itself.
- Host: GitHub
- URL: https://github.com/guitarbum722/qualified
- Owner: Guitarbum722
- License: mit
- Created: 2017-12-02T22:26:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-02-07T17:05:28.000Z (over 5 years ago)
- Last Synced: 2026-01-26T13:46:07.826Z (5 months ago)
- Topics: delimiter, go, golang, library, text
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# qualified
A simple library to deal with delimited strings that _could_ contain the delimiter in the data itself.
### Features
* Split strings by a delimiter and escape the delimiter character if contained in a qualified text field.
* ex. `one,two,"three,four",five`
```go
fields := qualified.SplitWithQual("Ohhi, mark", ",", "")
fmt.Println(fields) // [Ohhi mark]
```
* Get a map that contains the length of each field
```go
lens := qualified.FieldLengths("\"Ohhi, mark\",\"Hey bud\"", ",", "\"")
fmt.Println(lens) // map[0:12 1:9]
```