Definition:Substring

Definition
Let $\LL$ be a formal language with alphabet $\AA$.

Let $S$ be a string in $\AA$.

Let $T$ be a string in $\AA$ such that:
 * $S = S_1 T S_2$

where:
 * $S_1$ and $S_2$ are strings in $\AA$ (possibly null);
 * $S_1 T S_2$ is the concatenation of $S_1$, $T$ and $S_2$.

Then $T$ is called a substring of $S$.

It follows from this definition that $S$ is a substring of itself (by considering $S_1$ and $S_2$ as both null).

Also see

 * The initial part of a string $S$ is a substring of $S$.