Write a function to find a substring in a string. Test your code, write the test cases.
Utilisateur anonyme
public static void main(String[] args) { String str = "HelloWorld Vivek"; String ptr = ""; for ( int i = 0 ; i < str.length(); i++ ) { for ( int j = i+1; j <= str.length() ; j++) { ptr = str.substring(i,j); System.out.println(ptr); } } }