This is a strange question but is the whole string considered a substring of itself? Ie: String "cheesecake" has a substring "cheesecake".
Asked
Active
Viewed 1,509 times
3
-
Why not? It is. Maybe the question can be asked at http://english.stackexchange.com/questions/tagged/terminology, what to consider a "substring". – Wiktor Stribiżew Nov 02 '16 at 18:46
-
I understand a string to be a substring of itself, unless you want a _proper substring_ (see also https://en.wikipedia.org/wiki/Substring). – user2314737 Nov 03 '16 at 08:27
1 Answers
2
A string is a substring of itself. Wikipedia says the same.
Also, if you consider "string" as an amalgamation of set of characters, by definition of set - every set is a subset of itself.
Hence the answer - YES.

vamsi krishna
- 21
- 2