diff --git a/dist/string.js b/dist/string.js index 683b38a..bb79ad7 100644 --- a/dist/string.js +++ b/dist/string.js @@ -143,7 +143,7 @@ string.js - Copyright (C) 2012-2014, JP Richardson var s = this.s; var startPos = s.indexOf(left); var endPos = s.indexOf(right, startPos + left.length); - if (endPos == -1 && right != null) + if ((endPos == -1 && right != null) || (startPos == -1)) // return null string even if left string is not found return new this.constructor('') else if (endPos == -1 && right == null) return new this.constructor(s.substring(startPos + left.length)) @@ -1181,4 +1181,4 @@ string.js - Copyright (C) 2012-2014, JP Richardson },{"./_count":1,"./_splitLeft":2,"./_splitRight":3}]},{},[4]) (4) -}); \ No newline at end of file +});