Example usage for org.apache.commons.lang3 StringUtils appendIfMissing

List of usage examples for org.apache.commons.lang3 StringUtils appendIfMissing

Introduction

In this page you can find the example usage for org.apache.commons.lang3 StringUtils appendIfMissing.

Prototype

public static String appendIfMissing(final String str, final CharSequence suffix,
        final CharSequence... suffixes) 

Source Link

Document

Appends the suffix to the end of the string if the string does not already end with any the suffixes.

Usage

From source file:kenh.expl.functions.AppendIfMissing.java

public String process(String str, String suffix, String[] suffixes, boolean ignoreCase) {
    if (ignoreCase)
        return StringUtils.appendIfMissingIgnoreCase(str, suffix, suffixes);
    else/*from  w w  w. j  a va  2  s . c o m*/
        return StringUtils.appendIfMissing(str, suffix, suffixes);
}

From source file:kenh.expl.functions.AppendIfMissing.java

public String process(String str, String suffix, String suffixes, boolean ignoreCase) {
    if (ignoreCase)
        return StringUtils.appendIfMissingIgnoreCase(str, suffix, suffixes);
    else//w w w  .ja  va  2s  .  co  m
        return StringUtils.appendIfMissing(str, suffix, suffixes);
}