jprichardson/string.js

between bug

lukluk opened this issue · 3 comments

var S = require('string'); let mynext = S('Money ] Family ').between('[', ']').s console.log("I choose ", mynext)
it should be empty string not "money"

You may would like to add this line to the between function.
Incase you want it as an empty string

 if (startPos == -1 || endPos == -1) return new this.constructor('');

The main function does not check if one of the quotes were not exist..

published PR
#223

@lukluk interesting find