You should first test that the return value from index is greater than $i or you may get unexpected results.
In reply to Re^2: Substring consisting of all the characters until "character X"?
by jwkrahn
in thread Substring consisting of all the characters until "character X"?
by TheMartianGeek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |