美文网首页字符
URLDecoder中的%处理

URLDecoder中的%处理

作者: 星钻首席小管家 | 来源:发表于2022-04-01 09:13 被阅读0次
/**
     * 不匹配%后面两位为数字或字母(包括大小写)的字符
     * @param input
     * @return
     */
    public static String removePercentSign(String input){
        input = input.replaceAll("%(?![0-9a-fA-F]{2})", "%25");
        return input;
    }
        keyword = StringHandle.removePercentSign(keyword);
        dto.setKeyword(URLDecoder.decode(keyword, "UTF-8"));

相关文章

网友评论

    本文标题:URLDecoder中的%处理

    本文链接:https://www.haomeiwen.com/subject/ygoojrtx.html