liveBook · Manning

Substring

A substring is a contiguous sequence of characters contained within a larger string or character sequence.

How 5 Manning books explain it

Get Programming: Learn to code with Python

A substring is a contiguous sequence of characters extracted from a string.

How it is used
Extracts and locates parts of strings to process names and larger bodies of text.
How deep it goes
Works through slice bounds and steps, then explains find() and rfind() results.
Examples
Uses "Python rules!" slices, word searches, and full names split for a name-mashup program.
What you can do after
Build it from scratch: split input names into stored parts and combine them in a name-mashup program.

Read how Get Programming: Learn to code with Python explains substring →

Advanced Algorithms and Data Structures

A substring is a contiguous sequence of characters contained within a string.

How it is used
Uses substrings to advance trie and radix-trie searches through character paths and multi-character edge labels.
How deep it goes
Explains recursive decomposition, terminal checks, failed paths, and radix common-prefix cases, but does not develop general substring algorithms.
Examples
Uses recursive first-character splitting, missing-edge failure, intermediate-node failure, and four radix edge-matching cases.
What you can do after
Apply it via trie or radix-trie search to follow complete keys and diagnose prefix or edge-matching failures.

Read how Advanced Algorithms and Data Structures explains substring →

The Well-Grounded Rubyist, Fourth Edition

A substring is a contiguous sequence of characters extracted from a string or string-like value.

How it is used
Supports Ruby string inspection, extraction, searching, removal, and replacement.
How deep it goes
Explains indexes, lengths, ranges, searches, mutation, and regexp matching, while deferring detailed regular-expression syntax.
Examples
Uses irb examples for character indexes, ranges, literal and regexp searches, deletion, and replacement.
What you can do after
Apply it via Ruby's [], slice, slice!, and []= methods to inspect and edit string content.

Read how The Well-Grounded Rubyist, Fourth Edition explains substring →

Learn C++ by Example

A substring is a contiguous sequence of characters taken from a string.

How it is used
Uses substrings to locate overlapping dictionary words in a small answer-smash game.
How deep it goes
Explains substring extraction through working C++ code, prefix comparison, repeated offsets, and a no-match result.
Examples
Demonstrates word.substr(1) producing "har", matching "harsh", and shortening "struct" through successive offsets.
What you can do after
Apply it via C++ string APIs to extract prefixes, compare stems, and assemble overlapping words.

Read how Learn C++ by Example explains substring →

100 Go Mistakes and How to Avoid Them

A substring is a contiguous portion of a string obtained through a string operation such as slicing.

How it is used
Diagnoses incorrect byte indexing and memory retention when extracting portions of Go strings.
How deep it goes
Explains byte-versus-rune slicing and shared backing arrays, then demonstrates copying; it does not specify compiler-independent sharing behavior.
Examples
Uses Hello, World!, multibyte Hêllo, and UUID-prefixed log messages to expose byte indexing and retention effects.
What you can do after
Diagnose substring-related retention and choose byte slicing, rune conversion, or copying for the situation.

Read how 100 Go Mistakes and How to Avoid Them explains substring →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.