code: private static int skipCommentsAndQuotes(char[] statement, int position) {
          for (int i = 0; i < START_SKIP.length; i++) {
              if (statement[position] == START_SKIP[i].charAt(0)) {
                  boolean match = true;
                  for (int j = 1; j < START_SKIP[i].length(); j++) {
                      if (!(statement[position + j] == START_SKIP[i].charAt(j))) {
                          match = false;
                          break;
                      }
                  }
                  if (match) {
                      int offset = START_SKIP[i].length();
                      for (int m = position + offset; m < statement.length; m++) {
                          if (statement[m] == STOP_SKIP[i].charAt(0)) {
                              boolean endMatch = true;
                              int endPos = m;
                              for (int n = 1; n < STOP_SKIP[i].length(); n++) {
                                  if (m + n >= statement.length) {
                                      // last comment not closed properly
                                      return statement.length;
                                  }
                                  if (!(statement[m + n] == STOP_SKIP[i].charAt(n))) {
                                      endMatch = false;
                                      break;
                                  }
                                  endPos = m + n;
                              }
                              if (endMatch) {
                                  // found character sequence ending comment or quote
                                  return endPos + 1;
                              }
                          }
                      }
                      // character sequence ending comment or quote not found
                      return statement.length;
                  }
  
              }
          }
          return position;
      }
docs: Skip over comments and quoted names present in an SQL statement
  
  @param statement character array containing SQL statement
  @param position  current position of statement
  @return next position to process after any comments or quotes are skipped