WordGarden.io

substring

C2
Rare

Pronunciation

UK

    US

      Meanings

      Noun

      1. a contiguous sequence of characters within a larger string

      Beyond the definition

      Imagine you have a long sentence—that's your "string." Now, pick any consecutive part of that sentence. That smaller section within the bigger sentence is a "substring." It's like finding a hidden treasure within a map!

      Programmers use this term all the time when working with text or code. If you have the string "Mississippi," then "issip" and "si" are both substrings. But "Missp" isn't, because those letters aren't positioned right next to each other in that specific order. Think of it as a continuous slice taken from a larger whole. You can even find an empty substring at the beginning or end of any string!

      Examples

      1. 1

        Word parts

        In `"notebook"`, `"note"` is a substring.

      2. 2

        Username check

        The app checks whether the username contains the substring `"admin"`.

      3. 3

        Programming

        Some programming languages let you extract a substring by giving a start position and a length.

      See also

      Similar

      • string segment
      • text fragment

      Shades of meaning

      Contrast

      • whole string
      • superstring

      Do not confuse

      • subsequence

      Used with (collocations)

      • extract a substring
      • substring search
      • substring match
      • start index and length

      Word family

      Explore

      • regular expression
      • string manipulation

      Forms and spellings

      1 form open this card.

      Main spelling

      • substringnoun