How to normalize a URL in Java?

后端 未结 8 1156
孤独总比滥情好
孤独总比滥情好 2020-12-09 01:27

URL normalization (or URL canonicalization) is the process by which URLs are modified and standardized in a consistent manner. The goal of the normalization p

8条回答
  •  借酒劲吻你
    2020-12-09 02:07

    Im have a simple way to solve it. Here is my code

    public static String normalizeURL(String oldLink)
    {
        int pos=oldLink.indexOf("://");
        String newLink="http"+oldLink.substring(pos);
        return newLink;
    }
    

提交回复
热议问题