Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   remove null rows from 2D array (http://www.go4expert.com/forums/remove-null-rows-2d-array-t21692/)

doha786 7Apr2010 13:02

remove null rows from 2D array
 
hi,
the method of my program return rows with some values... now i need to use condition of values to show. in this case its returning conditional values including null rows.

how can i remove null rows from arrays ?
Code:

public String[][] process(String searchName, String value){
..
String[][] row=null;

Map<String, File> names = new HashMap<String, File>();

try{ 
..
...

 row = new String[names.keySet().size()][];
int i = 0;
 for (String found: names.keySet()) {
..
..
if(file.length()>1024){
row[i] =new String[]{found, file.getName(), Long.toString(file.length())};
i++;



}
}
catch(Exception e) {e.printStackTrace() }
 
return row;

please help to figure out this....


All times are GMT +5.5. The time now is 22:09.