1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

remove null rows from 2D array

Discussion in 'Java' started by doha786, Apr 7, 2010.

  1. doha786

    doha786 New Member

    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()) {
    ..
    ..
    [B]if(file.length()>1024){[/B]
    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....
     

Share This Page