1,048 views

2 Answers

Best answer
1 votes
1 votes

A proper substring PS of a string S is a substring of S which is not equal to S. Meaning the set of character (substring) is in S but never equal to S.

Example: S = SUBSTRING

                PS = STRING

                PS exists in S. PS cannot be SUBSTRING

selected by
1 votes
1 votes

A substring of a string S {\displaystyle S} S is a string S ′ {\displaystyle S'} S' that occurs "in" S {\displaystyle S} S. For example, "the best of" is a substring of "It was the best of times". This is not to be confused with subsequence, which is a generalization of substring. For example, "Itwastimes" is a subsequence of "It was the best of times", but not a substring.

Prefix and suffix are special cases of substring. A prefix of a string S {\displaystyle S} S is a substring of S {\displaystyle S} S that occurs at the beginning of S {\displaystyle S} S. A suffix of a string S {\displaystyle S} S is a substring that occurs at the end of S {\displaystyle S} S.

The list of all substrings of the string "apple" would be "apple", "appl", "pple", "app", "ppl", "ple", "ap", "pp", "pl", "le", "a", "p", "l", "e", "".

Related questions

1 votes
1 votes
1 answer
1
Abbas Ahmad asked Nov 30, 2018
413 views
If a grammar G is both left linear as well as right linear then,what should be the case a) G is always not regularb) G may or may not be regularc) something else
0 votes
0 votes
2 answers
4
rohankrishan asked Jun 29, 2022
248 views
Example: 11110100000111 should be accepted. There are 6 zeros. 6 is divisble by 2 and 3. This machine required at least six states.