摘要: 描述:判断字符串是否以指定字符或子字符串结尾。 语法:str.endswith("suffix", start, end) 或 str[start,end].endswith("suffix") 用于判断字符串中某段字符串是否以指定字符或子字符串结尾。 —> bool 返回值为布尔类型(True,F 阅读全文
posted @ 2022-04-18 09:35 Cumuluslyy 阅读(256) 评论(0) 推荐(0)
摘要: 一、增强for循环增强for循环的作用: 简化迭代器的书写格式。(注意:增强for循环的底层还是使用了迭代器遍历。)增强for循环的适用范围: 如果是实现了Iterable接口的对象或者是数组对象都可以使用增强for循环。增强for循环的缺点:增强for循环和iterator遍历的效果是一样的,也就 阅读全文
posted @ 2022-04-17 19:19 Cumuluslyy 阅读(66) 评论(0) 推荐(0)
摘要: 1 try { 2 FileOutputStream out = new 3 FileOutputStream(FileDescriptor.out); 4 out.write('A'); 5 out.close(); 6 } 7 catch (IOException e) {} 8 FileDes 阅读全文
posted @ 2022-04-15 09:04 Cumuluslyy 阅读(57) 评论(0) 推荐(0)