Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dist/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ string.js - Copyright (C) 2012-2014, JP Richardson <[email protected]>
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))
Expand Down Expand Up @@ -1181,4 +1181,4 @@ string.js - Copyright (C) 2012-2014, JP Richardson <[email protected]>

},{"./_count":1,"./_splitLeft":2,"./_splitRight":3}]},{},[4])
(4)
});
});