首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

将文本里的内容变换为小写

2012-09-01 
将文本里的内容转换为小写public static void main(String[] args) {try {File file new File(c:\\old.s

将文本里的内容转换为小写

public static void main(String[] args) {try {File file  = new File("c:\\old.sql");FileReader fr = new FileReader(file);FileWriter fw = new FileWriter("c:\\new.sql");char[] bt = new char[1024];int count;while ((count = fr.read(bt)) > 0) {String str = new String(bt).toLowerCase();//将old.sql中的内容转化为小写bt = str.toCharArray();fw.write(bt, 0, count); // 重点}fr.close();fw.close();} catch (IOException e) {e.printStackTrace();}System.out.println("finished...");}

热点排行