
thumb|"string" is a substring of "substring"
thumb|"string" is a substring of "substring"
In formal language theory and computer science, a substring is a contiguous sequence of characters within a string. For instance, "the best of" is a substring of "It was the best of times". In contrast, "Itwastimes" is a subsequence of "It was the best of times", but not a substring.
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).