loginid = name.substring(0,space);
loginid = loginid.substring(0,space);
  public String generateLogin() {    String loginid = getName();        // no name - try email    if (loginid == null) loginid = getEmail();    // ahhh - still none - randomise    if (loginid == null) loginid = StringUtils.randomString(6);        int space = loginid.indexOf(' ');    if (space > 0) {      loginid = name.substring(0,space);      space ++;      if (space < name.length()) loginid += name.charAt(space);    } else {      // try and make the best of it if we have a name that is actually an email address      int at = loginid.indexOf('@');      int dot = loginid.indexOf('.');      if (dot != -1 && dot < at) at = dot;      if (at > 0) loginid = loginid.substring(0,at);    }        // check to see if we already have this login id    Column loginColumn = getBoardsDatabaseTables().getUserTable().getLoginColumn();    boolean found = loginColumn.selectionWhereEq(loginid).hasMoreElements();    String testId = new String(loginid);    int count = 0;    while (found) {      count++;      testId = new String(loginid);      String testIdString = "" + count;      for (int i=0; i < (2 - testIdString.length()); i++) {	testId += "0";      }      testId += count;      found = loginColumn.selectionWhereEq(testId).hasMoreElements();    }    return testId.trim();  }