code: public static String removeLineComment(String sql) { // with removing CR!
          assertSqlNotNull(sql);
          final StringBuilder sb = new StringBuilder();
          final List<String> lineList = splitList(sql, "\n");
          for (String line : lineList) {
              if (line == null) {
                  continue;
              }
              line = removeCR(line); // remove CR!
              if (line.trim().startsWith("--")) {
                  continue;
              }
              final List<DelimiterInfo> delimiterList = extractDelimiterList(line, "--");
              int realIndex = -1;
              indexLoop: for (DelimiterInfo delimiter : delimiterList) {
                  final List<ScopeInfo> scopeList = extractScopeList(line, "/*", "*/");
                  final int delimiterIndex = delimiter.getBeginIndex();
                  for (ScopeInfo scope : scopeList) {
                      if (scope.isBeforeScope(delimiterIndex)) {
                          break;
                      }
                      if (scope.isInScope(delimiterIndex)) {
                          continue indexLoop;
                      }
                  }
                  // found
                  realIndex = delimiterIndex;
              }
              if (realIndex >= 0) {
                  line = line.substring(0, realIndex);
              }
              sb.append(line).append("\n");
          }
          final String filtered = sb.toString();
          return filtered.substring(0, filtered.length() - "\n".length());
      }
docs: Remove line comments. <br>
  And CR is removed.
  @param sql The string of SQL. (NotNull)
  @return The filtered string. (NotNull)