Collector-and-Stream.reduce() 背景删除字符串中的破折号和空字符 当然,最简洁的方式是 String s = number.replace(“ “, “”).replace(“-“, “”);但这里暂时忽略这种方案,只是为了指出该背景 一种较复杂的方案是使用 Stream,例如 12345678910private String justCase(String str){ retu 2022-11-03 #Java