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

com.github.jackpanz.spring.beetl.StringUitls Maven / Gradle / Ivy

package com.github.jackpanz.spring.beetl;


import org.apache.commons.lang3.StringUtils;

import java.util.Collection;
import java.util.Iterator;

public class StringUitls {

    public String tostr(Object obj) {
        return obj == null ? null : String.valueOf(obj);
    }

    public boolean isBlank(String str) {
        return StringUtils.isBlank(str);
    }

    public boolean isNotBlank(String str) {
        return StringUtils.isNotBlank(str);
    }

    public boolean isEmpty(String str) {
        return StringUtils.isEmpty(str);
    }

    public boolean isNotEmpty(String str) {
        return StringUtils.isNotEmpty(str);
    }

    public boolean isNumeric(String str) {
        return StringUtils.isNumeric(str);
    }

    public String trim(String str) {
        return StringUtils.trim(str);
    }

    public boolean startsWith(String str, String search) {
        return StringUtils.startsWith(str, search);
    }

    public boolean endsWith(String str, String search) {
        return StringUtils.endsWith(str, search);
    }

    public int length(String str) {
        return StringUtils.length(str);
    }

    public String substring(String str, int start) {
        return StringUtils.substring(str, start);
    }

    public String substring(String str, int start, int end) {
        return StringUtils.substring(str, start, end);
    }

    public String substringBefore(String str, String separator) {
        return StringUtils.substringBefore(str, separator);
    }

    public String substringBeforeLast(String str, String separator) {
        return StringUtils.substringBeforeLast(str, separator);
    }

    public String substringAfter(String str, String separator) {
        return StringUtils.substringAfter(str, separator);
    }

    public String substringAfterLast(String str, String separator) {
        return StringUtils.substringAfterLast(str, separator);
    }

    public String substringBetween(String str, String separator) {
        return StringUtils.substringAfterLast(str, separator);
    }

    public String[] substringsBetween(String str, String open, String close) {
        return StringUtils.substringsBetween(str, open,close);
    }

    public String left(String str, int len) {
        return StringUtils.left(str, len);
    }

    public String right(String str, int len) {
        return StringUtils.right(str, len);
    }

    public String remove(String str, String separator) {
        return StringUtils.remove(str, separator);
    }

    public String removeStart(String str, String separator) {
        return StringUtils.removeStart(str, separator);
    }

    public String removeStartIgnoreCase(String str, String separator) {
        return StringUtils.removeStartIgnoreCase(str, separator);
    }

    public String removeEnd(String str, String separator) {
        return StringUtils.removeEnd(str, separator);
    }

    public String removeEndIgnoreCase(String str, String separator) {
        return StringUtils.removeEndIgnoreCase(str, separator);
    }

    public String join(Object[] array, String separator) {
        return StringUtils.join(array, separator);
    }

    public String join(Collection collection, String separator) {
        return StringUtils.join(collection, separator);
    }

    public String join(Iterator iterator, String separator) {
        return StringUtils.join(iterator, separator);
    }

    public String split(Iterator iterator, String separator) {
        return StringUtils.join(iterator, separator);
    }

    public String[] split(String str, String separator) {
        return StringUtils.split(str, separator);
    }

    public boolean contains(String str, String separator) {
        return StringUtils.contains(str, separator);
    }

    public boolean contains(Object obj, String separator) {
        if( obj == null ){
            return false;
        }
        return StringUtils.contains(String.valueOf(obj), separator);
    }

    public String upperCase(String str) {
        return StringUtils.upperCase(str);
    }

    public String lowerCase(String str) {
        return StringUtils.lowerCase(str);
    }

    public String replaceOnce(String text, String searchString, String replacement) {
        return StringUtils.replaceOnce(text, searchString, replacement);
    }

    public String replace(String text, String searchString, String replacement) {
        return StringUtils.replace(text, searchString, replacement);
    }


    public int indexOf(String str, String searchStr) {
        return StringUtils.indexOf(str,searchStr);
    }

    public int lastIndexOf(String str, String searchStr) {
        return StringUtils.lastIndexOf(str,searchStr);
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy