3
Answers

How to print each substring of a string ?

Photo of Deepak Verma

Deepak Verma

14y
2.3k
1
Suppose, we have a string str = "This is a Text Book"

Now, we need to print each substring(individually) of str as :

This
is
a
Text
Book

Please anyone write a code snippet to do so.

Answers (3)