(I have no idea what to title this, so apologies if it's vague or inaccurate. I looked around the 'Net for an answer to this, but I wasn't sure what to search for this problem, thus, I came here.)
I need a method to take a string and take the characters from it and put it into a pattern.
So, let's say String s = "abcd".
This method needs to take that and print "abcd," "bcd," "abc," "cd," "bc," "ab," "d," "c," "b," "a".
I have completely no idea how to make this work, so anything would be useful.
Below is a method that is similar to what I'm trying to achieve.
void printSub3(String s){
for(int i = 0; i < s.length(); i++){
for(int j = 0; j < s.length()-i; j++){
System.out.printf(s.substring(s.length()-j-i-1, s.length()-j)+", ");
}
}
}