Does anyone have or can make a function for Java that removes an index from an array?
Like table.remove in lua.
I have tried googling, last night for about 1 hour, but all I could find was removing indexes from lists.
I've also tried making a function which kept causing errors with array index out of bounds which I could find the source of the error ><
Something like
String a[] = {"text","hello","cheese"};
System.out.println(Arrays.toString(a)); // output [text, hello, cheese]
// Not sure how it would work, globally or remove it and then return a new array
removeIndex(a, 2);
// or
a = removeIndex(a, 2);
System.out.println(Arrays.toString(a)); // output [text, cheese]
I did read somewhere that java arrays cannot be changed in any way so I would guess the only way is to make a function.