摘要: 1.获取字符串长度 int len = str.length(); 2. int indexOf(String s):字符串s在指定字符串中首次出现的索引位置,如果没有检索到字符串s,该方法返回-1 int lastIndexOf(String s):字符串s在指定字符串中最后一次出现的索引位置,如 阅读全文
posted @ 2023-10-07 15:27 非酋的懊悔 阅读(43) 评论(0) 推荐(0)
摘要: 下面是stream的 filter 和 forEach 的使用 filter 来过滤出满足条件的元素 forEach 逐一处理流中的元素 import java.util.ArrayList; import java.util.List; public class Demo2Steam { publ 阅读全文
posted @ 2023-10-07 09:06 非酋的懊悔 阅读(40) 评论(0) 推荐(0)