use -1 default for substring()