Write a Java program to find and display all substrings in string

By | February 9, 2017

Java program to find and display all substrings


This program find all substrings of a string and the prints them.

For example substrings of “cat” are :- “c”, “ca”, “cat”, “a”, “at” and “t”. substring method of String class is used to find substring.

Java code to print substrings of a string is given below.

 

SOURCE CODE ::

 

OUTPUT ::

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *