private String camelCaseCommandName(String cmd){
  StringBuilder dest=new StringBuilder();
  char previous='_';
  for (int iter=0; iter < cmd.length(); iter++) {
    char current=cmd.charAt(iter);
    if (current == '_' || current == ' ') {
      previous='_';
      continue;
    }
    if (current >= 'a' && current <= 'z' || current >= 'A' && current <= 'Z' || current >= '0' && current <= '9') {
      if (previous == '_' || previous == ' ') {
        dest.append(Character.toUpperCase(current));
      }
 else {
        dest.append(Character.toLowerCase(current));
      }
      previous=current;
    }
 else {
      previous='_';
    }
  }
  return dest.toString();
}

private String camelCaseCommandName ( String cmd ) { StringBuilder dest = new StringBuilder ( ) ; char previous = '_' ; for ( int iter = 0 ; iter < cmd . length ( ) ; iter ++ ) { char current = cmd . charAt ( iter ) ; if ( current == '_' || current == ' ' ) { previous = '_' ; continue ; } if ( current >= 'a' && current <= 'z' || current >= 'A' && current <= 'Z' || current >= '0' && current <= '9' ) { if ( previous == '_' || previous == ' ' ) { dest . append ( Character . toUpperCase ( current ) ) ; } else { dest . append ( Character . toLowerCase ( current ) ) ; } previous = current ; } else { previous = '_' ; } } return dest . toString ( ) ; }
converts a command upper case underscored string to cammel case e . g . : myform_my_command to myformmycommand
