工具箱
来源:互联网 发布:题库系统源码 编辑:程序博客网 时间:2024/04/27 21:19
递归输出文件夹下的所有文件
public static void listFileName(File file){ File[] files = file.listFiles(); for(File f : files){ if(f.isDirectory()){ listFileName(f); } System.out.println(f.getName()); } }
统计某个单词出现的次数
public static int wordCount(String filePath, String word) throws IOException{ int count = 0; BufferedReader reader = new BufferedReader(new FileReader(filePath)); String line = ""; while((line = reader.readLine()) != null){ count += ((line.length() - line.replace(word, "").length()) % line.length()) / word.length(); } reader.close(); return count; }
0 0
- 工具箱
- 工具箱
- 工具箱
- 工具箱
- 工具箱
- 工具箱
- Windows/支持工具箱/资源工具箱/调试工具箱
- 技术工具箱
- 工具箱代码
- Matlab 工具箱
- 站长工具箱
- 马尔可夫工具箱
- levelset工具箱
- 【数学题】工具箱
- Xtools工具箱
- 总变分去噪工具箱
- 自用工具箱
- Toolboxes--工具箱
- HDOJ 1862 EXCEL排序
- ANDROID 中常用的第三方框架
- android--checkbox(内部监听器)
- Counting Leaves
- WebService学习总结十一 使用Ajax访问WebService和使用HttpURLConnection访问WebService
- 工具箱
- android判断当前系统版本的等级
- EM算法的一些整理
- python3的模块import操作
- 大型网站架构演化发展历程
- python初级项目课(一)
- CSS的内联和块元素
- UVA 1587 Box
- Power of Two