public static int commentStart(String line){
  boolean insidequote=false;
  for (int i=0; i < line.length(); i++) {
    char current=line.charAt(i);
    if (current == '\'') {
      insidequote=!insidequote;
    }
 else     if (!insidequote) {
      if (current == ';') {
        return i;
      }
    }
  }
  return -1;
}

public static int commentStart ( String line ) { boolean insidequote = false ; for ( int i = 0 ; i < line . length ( ) ; i ++ ) { char current = line . charAt ( i ) ; if ( current == '\'' ) { insidequote = ! insidequote ; } else if ( ! insidequote ) { if ( current == ';' ) { return i ; } } } return - 1 ; }
returns the index inside the given string where a comment starts ( usually the first " ; " )
