package com.zjrs.ggfw.rlzysc.utils;

public class RlzyscUtils {

    public static String str2SercurityStr(String str, Integer start_number, Integer end_number) {
        if(org.apache.commons.lang.StringUtils.isNotBlank(str)) {
            int length = str.length();
            if(length <= start_number) {
                return str;
            }

            String start_str = str.substring(0, start_number);
            String end_str = (end_number > 0 && end_number < length) ? str.substring(length - end_number, length) : "";
            String star_str = "";
            int index = 0;
            do {
                index++;
                star_str += "*";
            }while(index < (length - start_number - end_number));

            return start_str + star_str + end_str;
        }
        return "";
    }

}
