Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 548 Bytes

README.md

File metadata and controls

20 lines (14 loc) · 548 Bytes

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
fields := qualified.SplitWithQual("Ohhi, mark", ",", "")
fmt.Println(fields) // [Ohhi  mark]
  • Get a map that contains the length of each field
lens := qualified.FieldLengths("\"Ohhi, mark\",\"Hey bud\"", ",", "\"")
fmt.Println(lens) // map[0:12 1:9]