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

uncle.utils.StringUtil Maven / Gradle / Ivy

The newest version!
package uncle.utils;

import org.apache.commons.lang3.StringUtils;

/**
 * Created by hujianbo on 2018/1/18.
 */
public class StringUtil {
    /*
    * 判断字符串是否为空
    * */
    public static boolean isEmpty(String str) {
        if (str != null) {
            str = str.trim();
        }
        return StringUtils.isEmpty(str);
    }

    /*
    * 判断字符串是否非空
    * */
    public static boolean isNotEmpty(String str) {
        return !isEmpty(str);
    }

    /**
     * 分割字符串
     *
     * @param str
     * @return
     */
    public static String[] splitString(String str, String s) {
        if (isNotEmpty(str)) {
            return StringUtils.split(str, s);
        }
        return null;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy