Given a string, split the string into two substrings at every possible point. The rightmost substring is a
Code :
public class String_Possible_Substrings {
public static void main(String args[]) {
int a,b;
String str= new String("quick brown fox jumps over the lazy dog");
//Given String
System.out.println("All Possible Substrings of a Given String :
");
for(a=0;a<str.length();a++)
{
for(b=a+1;b<str.length()-a;b++);
{
System.out.println(str.substring(a,b));//Printing all the Possible Substring of a Given
String
}
}
}
}
Get Answers For Free
Most questions answered within 1 hours.