用Java去掉换行,输出一行

来源:互联网 发布:vb.net 用户控件 编辑:程序博客网 时间:2024/05/01 20:05

public class Test {

 public static void main(String[] args) {


  String s = "'阿萨德法师打发" +

                      "阿萨德"+ 

                    "阿萨德"+

                       "阿萨德"+

                     "阿萨德" + "edaeafd'";
    System.out.println("转换前:"+s);


  s = s.replaceAll("\n", " ");


  System.out.println("转换后:"+s);
  }
}
0 0
原创粉丝点击