public static String [ ] trimArray ( String [ ] strings ) { for ( int i = 0 ; i < strings . length ; i ++ ) { strings [ i ] = strings [ i ] . trim ( ) ; } return strings ; }
Trims all elements inside the array modifying the original array .