摘要: public class digui { /* * * 需求4:从键盘接收一个文件夹路径,把文件夹中的所有文件以及文件夹的名字按层级打印,例如: 把文件夹中的所有文件以及文件夹的名字按层级打印 * */ public static void main(String[] args) throws Ex 阅读全文
posted @ 2020-07-13 21:51 一块 阅读(179) 评论(0) 推荐(0) 编辑
摘要: public class digui { /* * * * 需求3:从键盘接收两个文件夹路径,把其中一个文件夹中(包含内容)拷贝到另一个文件夹中 * */ public static void main(String[] args) throws Exception { File src = get 阅读全文
posted @ 2020-07-13 21:24 一块 阅读(172) 评论(0) 推荐(0) 编辑
摘要: String str6 = "hello"; String str7 = "HELLO"; System.out.println(str6.equalsIgnoreCase(str7)); System.out.println(str6.replaceAll("l", "8")); //将所有的L替 阅读全文
posted @ 2020-07-13 18:11 一块 阅读(1453) 评论(0) 推荐(0) 编辑
摘要: String str6 = "hello"; String str7 = "HELLO"; System.out.println(str6.equalsIgnoreCase(str7)); //不区分大小写比较字符串的内容 阅读全文
posted @ 2020-07-13 17:58 一块 阅读(467) 评论(0) 推荐(0) 编辑
摘要: String str5 = "293陕西力拓888"; System.out.println(str5.startsWith("293")); System.out.println(str5.endsWith("888")); if(str5.startsWith("293")) { System. 阅读全文
posted @ 2020-07-13 17:52 一块 阅读(1397) 评论(0) 推荐(0) 编辑
摘要: String str3 = "helloworld"; System.out.println(str3.substring(3)); System.out.println(str3.substring(2, 8)); String[] arr = str3.split("ow"); for (Str 阅读全文
posted @ 2020-07-13 17:37 一块 阅读(369) 评论(0) 推荐(0) 编辑
摘要: String str3 = "helloworld"; System.out.println(str3.substring(3)); System.out.println(str3.substring(2, 8)); String[] arr = str3.split("ow"); for (Str 阅读全文
posted @ 2020-07-13 17:34 一块 阅读(4681) 评论(0) 推荐(0) 编辑
摘要: String str = " 好好学习,天天向上 "; System.out.println(str.charAt(5)); // 取出指定位置的字符 System.out.println("str的长度为:" + str.length()); // 取得一个字符串的长度 System.out.pr 阅读全文
posted @ 2020-07-13 17:28 一块 阅读(272) 评论(0) 推荐(0) 编辑
摘要: public class StringAPIDemo1 { public static void main(String[] args) { String str = "HELLO"; char c[] = str.toCharArray(); // 将字符串变为字符数组 for (int i = 阅读全文
posted @ 2020-07-13 15:04 一块 阅读(1380) 评论(0) 推荐(0) 编辑