A Way For Learning

Program to find substrings of a given string

No comments
#program to find substrings of a given string
class T1 {
public static void main(String[] args) {
String str="fun";
for (int i = 0; i < str.length(); i++)
{
for (int j = i+1; j <= str.length(); j++)
  {
  System.out.println(str.substring(i,j));
  }
}
}
}

No comments :

Post a Comment