package com.brilliance.mda.runtime.mda.util;

import org.slf4j.LoggerFactory;
import org.slf4j.Logger;

public class CharUtils {

    private static Logger logger = LoggerFactory.getLogger(CharUtils.class);

    public static String replaceHalfChs(String result){
        if(MdaUtils.isEmpty(result)){
            return "";
        }
        int orgLen = result.length();
        String newResult = result.replaceAll("�","");
        int len = newResult.length();
        if(len < orgLen){
            //存在乱码
            logger.warn("存在特殊字符的字符串:{}",result);
            logger.warn("去除特殊字符:{}",newResult);
        }
        return newResult;
    }
}
