So I noticed something.
When doing a recursive method on codingbat, I looked at the:
String abc = "abc";
String mod = abc.substring(1);
System.out.println(mod); //prints "bc"
So I thought:
Hey, why not have a substring-like method for arrays?
For example:
String[] abc = {"a", "b", "c"};
String[] mod = abc[1, str.length];
for(int i = 0; i < mod.length; i++){
System.out.print(mod[i]);
if(i + 1 != mod.length){
System.out.print(", ");
}
}
// This would print out: "b, c"
So, as you can see from this, it is like the substring method as it adds the Objects from the first array to the second array from start index, to end index, but not including the end index (avoids OutOfBounds Exceptions).
How would this be going around to be made since I cannot seem to find the class that controls the "[ ]"'s since something has to regulate them because they aren't just "there" they had to be added in some way.
Thanks for any constructive criticism and feedback.
FirexRanger8