Page 1 of 1

SubStrReplace doesn't work if start+length>=len(string)

Posted: Wed Oct 02, 2013 5:12 am
by andenixa
SubStrReplace(str, replace_with, start, length:=0);

doesn't work if start + length >= the length of the string
which should be perfectly legal for POL since its indexations are 1-based

such that:

var myString := "Hello, World!";
SubStrReplace(myString , "Hell!", 7, length:=6);

>> Would cause an error: "Length out of range"

This patch fixes that issue.