All Downloads are FREE. Search and download functionalities are using the official Maven repository.

liqp.filters.Capitalize Maven / Gradle / Ivy

package liqp.filters;

class Capitalize extends Filter {

    /*
     * (Object) capitalize(input)
     *
     * capitalize words in the input sentence
     */
    @Override
    public Object apply(Object value, Object... params) {

        String original = super.asString(value);

        if (original.isEmpty()) {
            return original;
        }

        char first = original.charAt(0);

        return Character.toUpperCase(first) + original.substring(1);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy