第一次发现JavaScript中replace() 方法如果直接用str.replace("-","!") 只会替换第一个匹配的字符. 而str.replace(/\-/g,"!")则可以全部替换掉匹配的字符(g为全局标志). replace() The replace() method returns the string that results when you replace text matching its first argum
程序中都是以流的形式进行数据的传输和保存,在java.io包中数据流操作的两大类是字节流和字符流. 1. 字节流 InputStream和OutputStream是所有表示字节流的类的父类,它们都是抽象类,不能实例化. InputStream抽象类方法: public int read(byte b[]){ return read(b, 0, b.length); } ->从输入流读取数据字节到缓冲区数组b中,并返回实际读取的字节数. public int read(byte b[],