elgs / splitargs

Splits strings into tokens by given separator, treating quoted part as a single token.
17 stars 6 forks source link

Maximum amount of items to accept #4

Open haykam821 opened 6 years ago

haykam821 commented 6 years ago

This has almost everything I need for an args splitter, except being able to specify a count and ignoring separators after an amount of items has been reached.

Example

Here are some example inputs/outputs.

split("one two three four", 3) // [ "one", "two", "three four" ]
split("one two three", 0) // [ "one two three" ]
elgs commented 6 years ago

Thanks! That's a great idea. I will consider to improve it.