Citation:
A substring is a contiguous sequence of characters within a string. It can be as short as a single character or as long as the entire string itself, and it plays a crucial role in various string searching algorithms that help find occurrences of specific sequences within larger texts.