Let P be a string in .
P[i..j]: Array range notation character i to j inclusive indexed from 1 to length of string.
|P| denotes the length of string P.
: the string Q is a prefix of R. R = QS for some S.
Q = abc R = abcbbca S = bbca
: the string Q is a suffix of R. R = SQ for some S.
Q = bca R = abcbbca S = abcb