梦想起航

人生没有等出来的美丽,只有走出来的辉煌!~

导航

2012年11月13日 #

Java中截取文件名不要后缀

摘要: 例如:Filef=newFile("d:/d/abc.txt");f.getName()获得的是abc.txt,如果不需要后缀.txt,只要abc可以这样做:Stringtest=f.getName().substring(0,f.getName().lastIndexOf(".")); 阅读全文

posted @ 2012-11-13 18:47 梦想hust起航 阅读(3033) 评论(0) 推荐(0)

将文件夹中GBK编码的文档转化为utf-8编码的文档

摘要: package util;import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter;/*** @author 阅读全文

posted @ 2012-11-13 18:13 梦想hust起航 阅读(1605) 评论(0) 推荐(0)