Fast substring question

Just a quick question.

‘the’ is a substring of “A quick brown fox jumped there.” Because of the string “there”.

how about:

(1) ‘the’ and the string is “tadhase”.

(2) ‘the’ and the string is “heet”

are the two examples also falls in the substring? please explain. thanks

No in both cases - read for example Substring - Wikipedia

For (1) this is called subsequence - Subsequence - Wikipedia.

(2) would be hard to define, something like “Can we from characters ‘heet’ create word ‘the’.”

1 Like