3

This is a strange question but is the whole string considered a substring of itself? Ie: String "cheesecake" has a substring "cheesecake".

Aeolys
  • 31
  • 2
  • 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 Answers1

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.

https://en.wikipedia.org/wiki/Substring