如何在不考虑每个单词的大小写的情况下从字符串列表中删除重复元素,例如考虑以下代码片段
String str = "Kobe Is is The the best player In in Basketball basketball game .";
List<String> list = Arrays.asList(str.split("\\s"));
list.stream().distinct().forEach(s -> System.out.print(s+" "));
这仍然会产生与下面相同的输出,这是显而易见的。
Kobe Is is The the best player In in Basketball basketball game .
我需要以下结果。
Kobe Is The best player In Basketball game .