我们如何从String列表中删除重复元素而不考虑每个单词的大小写,例如考虑下面的代码片段
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+" "));
Run Code Online (Sandbox Code Playgroud)
这仍然提供与下面相同的输出,这是显而易见的
Kobe Is is The the best player In in Basketball basketball game .
Run Code Online (Sandbox Code Playgroud)
我需要如下结果
Kobe Is The best player In Basketball game .
Run Code Online (Sandbox Code Playgroud)