解决方案 »

  1.   

    不用正规式
    replaceAll(". ",".")
    toLowerCase()
      

  2.   

    确实replaceAll()和toLowerCase()就可以解决了,不知道是不是你问题没描述清楚
      

  3.   


    String url = "Http: //Www. Baidu. com";
            System.out.println(url.replaceAll("(?<=[\\.:])\\s+", "").toLowerCase());
      

  4.   

    package topics_390900603;public class Test {    public static void main(String[] args) {
            System.out.println("Http: //Www. Baidu. com".replace(": ", ":").replace(". ", ".").toLowerCase());
            System.out.println("Http: //Www. Baidu. com".replaceAll("(?<=[\\.:])\\s+", "").toLowerCase());
        }}还是#5的方法好http://www.baidu.com
    http://www.baidu.com