Hi All.
I've got an array of bytes (ASCII)
I need to work backwards and remove any spaces from this byte array.
I've tried looping backwards using a for loop, this never gets entered.
I've tried dumping into an arraylist and iterating backwards like so
ArrayList<Byte> listRemove = new ArrayList<Byte>();
for (int i = 0 ; i < bytResponse.length; i++){
listRemove.add(bytResponse);
}
ListIterator<Byte> listItByte = listRemove.listIterator();
while (listItByte.hasPrevious()) {
System.out.println(boo);
}
However, even that does not get entered into(the while loop).
The reason I'm doing is because I have a byte array and I wish to remove any spaces but starting from the back.
I'm running out of ideas on how I can remove my spaces! I know the ASCII code for space is 32, but without a means of even looping through the array, I can't even start on how I can do any comparisons without throwing any dereferencing errors.