breakIndex

size_t
breakIndex
(
string value
)

Examples

break index with no breaks should return the length of the string

"".breakIndex.should.equal(0);
"abc".breakIndex.should.equal(3);

break index with one break should return the position of the next item

"a b".breakIndex.should.equal(1);
"a\tb".breakIndex.should.equal(1);
"a\nb".breakIndex.should.equal(1);
`"abc" "def"`.breakIndex.should.equal(5);
`"a c" "def"`.breakIndex.should.equal(5);
`'a c' "def"`.breakIndex.should.equal(5);

break index with escaped strings

`"a\"c" "def"`.breakIndex.should.equal(6);
`'a\'c' "def"`.breakIndex.should.equal(6);

break index with bar string

`| a  b |`.breakIndex.should.equal(8);

Meta