public static String trimName(String line){
  int idx=line.indexOf("-");
  if (idx != -1) {
    line=line.substring(0,idx);
  }
  line=trimLine(line);
  idx=line.indexOf("(");
  if (idx == -1) {
    idx=line.indexOf(":");
  }
  if (idx != -1) {
    line=line.substring(0,idx);
  }
  return line.trim();
}

public static String trimName ( String line ) { int idx = line . indexOf ( "-" ) ; if ( idx != - 1 ) { line = line . substring ( 0 , idx ) ; } line = trimLine ( line ) ; idx = line . indexOf ( "(" ) ; if ( idx == - 1 ) { idx = line . indexOf ( ":" ) ; } if ( idx != - 1 ) { line = line . substring ( 0 , idx ) ; } return line . trim ( ) ; }
trims a line and removes everything behind colon
