从 JavaRdd 中删除以特定符号开头并后跟文本的行

问题描述

我在控制台中以这种方式显示一个 JavaRdd:

[2021-04-12 21:32:17] TestTracker | Starting Suite 'de.adag.TestSuiteVereinbarungen' 
. Which one will be used is undefined. Please,remove duplicated configuration file (or second PowerMock jar file) from class path to have stable tests.[2021-04-12 21:33:03] TestTracker | Finished Suite 'de.adag.TestSuitefinal'Execution duration '00:00:46' 
[2021-04-12 21:33:03] TestTracker | Starting Suite 'de.adag.TestSuitefinakServices' 

我想去掉第二行的文字,只留下[2021-04-12 21:33:03] TestTracker | Finished Suite 'de.adag.TestSuitefinal'Execution duration '00:00:46' 这意味着我想删除 . Which one will be used is undefined. Please,remove duplicated configuration file from class path to have stable tests.

这是我的代码

JavaRDD<String> filteredlines1 = filteredlines.map(line -> line.replaceAll("^\\.","").replaceAll("\\.$","")) ;

它对我不起作用。有没有人对此有任何想法:)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)