how to remove spaces from an array in java

Solutions on MaxInterview for how to remove spaces from an array in java by the best coders in the world

showing results for - "how to remove spaces from an array in java"
Emily
02 Feb 2019
1for (int i = 0; i < temp.length; i++){
2    temp[i] = if(!temp[i].trim().equals("") || temp[i]!=null)temp[i].trim();
3}