2024-01-20发表2024-01-20更新LeetCode每日一题几秒读完 (大约80个字)0次访问2788. 按分隔符拆分字符串2788. 按分隔符拆分字符串 难度: easy 原始链接: https://leetcode.cn/problems/split-strings-by-separator 标签: 模拟 解法一: 模拟java12345678910import java.util.regex.Pattern;class Solution { public List<String> splitWordsBySeparator(List<String> words, char separator) { return words.stream() .flatMap(word -> Arrays.stream(word.split(Pattern.quote(String.valueOf(separator))))) .filter(word -> !word.isEmpty()) .collect(Collectors.toList()); }}2788. 按分隔符拆分字符串https://wuhunyu.top/leetcode/2024/01/split-strings-by-separator/index.html作者wuhunyu发布于2024-01-20更新于2024-01-20许可协议#模拟