👉 In programming and computer science, a substring is a contiguous sequence of characters within a larger string. It can be either a single character or multiple consecutive characters that form part of a larger string. For example: - "Hello" contains the substring "llo". - "abcdefg" contains the substring "ab". Substrings are often used in search algorithms and data structures to efficiently find elements by their positions within other strings.