static String stripCommentChar()

in src/main/java/org/apache/commons/configuration2/PropertiesConfigurationLayout.java [300:320]


    static String stripCommentChar(final String s, final boolean comment) {
        if (StringUtils.isBlank(s) || isCommentLine(s) == comment) {
            return s;
        }
        if (!comment) {
            int pos = 0;
            // find first comment character
            while (PropertiesConfiguration.COMMENT_CHARS.indexOf(s.charAt(pos)) < 0) {
                pos++;
            }

            // Remove leading spaces
            pos++;
            while (pos < s.length() && Character.isWhitespace(s.charAt(pos))) {
                pos++;
            }

            return pos < s.length() ? s.substring(pos) : StringUtils.EMPTY;
        }
        return COMMENT_PREFIX + s;
    }