A prefix of a string T = t 1 t 2 … t n {\displaystyle T=t_{1}t_{2}\dots t_{n}} is a string P = p 1 p 2 … p m {\displaystyle P=p_{1}p_{2}\dots p_{m}} such that t 1 … t m = p 1 … p m {\displaystyle t_{1}\dots t_{m}=p_{1}\dots p_{m}} , where m ≤ n {\displaystyle m\leq n} . A proper prefix of a string is a prefix that is not equal to the string itself (it is shorter). A prefix can be seen as a special case of a substring.
The string ban is a prefix of the string banana:
ban
banana
T = banana ||| P = ban