Substring: Difference between revisions

Content deleted Content added
Substring: fix own typo; mv properties after example; wikilink forward references; avoid "you"
m sp
Line 19:
ana
 
The first occurrence is obtained with <math>p=</math><code>b</code> and <math>s=</math><code>na</code>, while the second occurenceoccurrence is obtained with <math>p=</math><code>ban</code> and <math>s</math> being the empty string.
 
A substring of a string is a [[#Prefix|prefix]] of a [[#Suffix|suffix]] of the string, and equivalently a suffix of a prefix. If <math>u</math> is a substring of <math>t</math>, it is also a [[subsequence]], which is a more general concept. The occurrences of a given pattern in a given string can be found with a [[string searching algorithm]]. Finding the longest string which is equal to a substring of two or more strings is known as the [[longest common substring problem]].