java/src/main/java/com/genexus/filters/ExpiresFilter.java
/**
     * Return the subset of the given <code>str</code> that is before the first
     * occurence of the given <code>separator</code>. Return <code>null</code>
     * if the given <code>str</code> or the given <code>separator</code> is
     * null. Return and empty string if the <code>separator</code> is empty.
     * 
     * @param str
     *            can be <code>null</code>
     * @param separator
     *            can be <code>null</code>
     * @return
     */
Return the subset of the given str that is before the first
occurence of the given separator. Return null
if the given str or the given separator is
null. Return and empty string if the separator is empty.

@param str
can be null
@param separator
can be null
@return
Return the subset of the given str that is before the first occurence of the given separator . Return null if the given str or the given separator is null . Return and empty string if the separator is empty . @param str can be null @param separator can be null @return
protected static String substringBefore(String str, String separator) {
        if (isEmpty(str) || separator == null) {
            return null;
        }
        if (separator.length() == 0) {
            return "";
        }
        int separatorIndex = str.indexOf(separator);
        if (separatorIndex == -1) {
            return str;
        }
        return str.substring(0, separatorIndex);
    }
protected static String substringBefore ( String str , String separator ) { if ( isEmpty ( str ) || separator == null ) { return null ; } if ( separator . length ( ) == 0 ) { return "" ; } int separatorIndex = str . indexOf ( separator ) ; if ( separatorIndex == - 1 ) { return str ; } return str . substring ( 0 , separatorIndex ) ; }
Return the subset of the given <code>str</code> that is before the first
 occurence of the given <code>separator</code>.
Return the subset of the given <code > str< / code > that is before the first occurence of the given <code > separator< / code > .