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

com.xiongyingqi.util.DomainHelper Maven / Gradle / Ivy

package com.xiongyingqi.util;

public class DomainHelper {
    /**
     * 移除主机字符,例如传入[email protected],那么该方法将截取@之前的字符返回admin
     *
     * @param str
     * @return
     */
    public static String removeDomain(String str) {
        if (str != null && !"".equals(str)) {
            int index = str.indexOf("@");
            if (index >= 0) {
                str = str.substring(0, index);
            }
        }
        return str;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy