空白删除,来自java字符串,具有直接MySQL源

时间:2013-08-19 06:17:30

标签: java regex

好吧,我有一个从java字符串中删除空格的问题,我已经查看了stackoverflow中提供的解决方案,但它们似乎在我的特定情况下不起作用:

How to remove duplicate white spaces in string using Java?
Java how to replace 2 or more spaces with single space in string and delete leading spaces only

我确实经历了这些,它确实适用于更简单的字符串,但在解析从MySQL表列(longtext)中提取的文本时失败了。我不知道它是否是DB特定的问题或其他什么,我无法想出任何可行的解决方案,我希望你们能帮助我....谢谢

例如:

String textToBeParsed="<paragraph>Dosage and Administration</paragraph><paragraph>Chinese Patients Taking Lipid-Modifying Doses ( ? 1 g/day Niacin) of Niacin-Containing Products (2.5)                                                         03/2010</paragraph><paragraph>Coadministration with Other Drugs (2.6)                                                                                                                                                                         03/2010</paragraph><paragraph>Myopathy/Rhabdomyolysis (5.1)</paragraph><paragraph>Warnings and Precautions</paragraph><paragraph>                                                                                                                                                                                                                                                03/2010</paragraph>";

P.S。:我需要删除只有复制品;

0 个答案:

没有答案