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

https://github.com/izarif/tssplit-lua

Lua implementation of tssplit python package
https://github.com/izarif/tssplit-lua

escape-sequences lua quotes split string-manipulation trim

Last synced: 4 months ago
JSON representation

Lua implementation of tssplit python package

Awesome Lists containing this project

README

          

# Trivial split for Lua

Lua implementation of [tssplit](https://github.com/mezantrop/tssplit/) python package

Donate via Boosty

## Usage

```lua
local ts = require("tssplit")

ts.split('--:--;--,--"--/--"--\'--:--\'--/"--^--',
{quote="\"'", delimiter=":;,", escape="/^", trim=""})

--> {'--', '--', '--', '----/------:----"----'}

ts.split('--:--;--,--"--/--"--\'--:--\'--/"--^--',
{quote="\"'", delimiter=":;,", escape="/^", trim="", quoteKeep=true})

--> {'--', '--', '--', '--"--/--"--\'--:--\'--"----'}

ts.split('--:--;--,--"--/--"--\'--:--\'--# Ignore this',
{quote="\"'", delimiter=":;,", escape="/^", trim="", quoteKeep=true, remark="#"})

--> {'--', '--', '--', '--"--/--"--\'--:--\'--'}
```