标签:
System.out.println("foo[0]".replaceAll("\\[(\\d+)\\]", ".$1")); //输出: foo.0
System.out.println(new String(new char[3]).replace("\0", "osc")); //输出: oscoscosc
BufferedReader br = new BufferedReader(new StringReader("osc1\r\nosc2\r\nosc3")); System.out.println(br.readLine()); System.out.println(br.readLine()); //输出: //osc1 //osc2
标签:
原文地址:http://my.oschina.net/joymufeng/blog/523412