code: public static String removeComments(String s) {
          int pos = s.indexOf("#");
          if (pos == -1) {
              return s;
          }
          return s.substring(0,pos).trim();
      }
docs: removeComments removes the comments starting with # in the text.
  
  @param s a line in the model.
  @return the line without comments.