public static String stripComments(String s,ParseResult result){
  int commentStart=s.indexOf(";");
  if (commentStart != -1) {
    s=s.substring(0,commentStart);
    result.commentStartPos=commentStart;
    int index=s.indexOf(" , ");
    while (index > -1) {
      result.commentStartPos-=2;
      index=s.indexOf(" , ",index + 3);
    }
  }
  return s.trim();
}

public static String stripComments ( String s , ParseResult result ) { int commentStart = s . indexOf ( ";" ) ; if ( commentStart != - 1 ) { s = s . substring ( 0 , commentStart ) ; result . commentStartPos = commentStart ; int index = s . indexOf ( " , " ) ; while ( index > - 1 ) { result . commentStartPos -= 2 ; index = s . indexOf ( " , " , index + 3 ) ; } } return s . trim ( ) ; }
removes comments from a line of code . comments are recognised by their beginning " ; "
