Concept Flow - Substring Search Patterns
Start: Text and Pattern
Set index i=0 in Text
Compare Pattern with Text[i..i+len(Pattern)-1
Pattern found at i
→Stop or continue
No
Increment i by 1
Check if i <= len(Text) - len(Pattern)
Yes
Stop: Pattern not found
↩Back to Compare
The search slides the pattern over the text one by one, comparing characters until a match is found or the text ends.