我有一个字符串变量s,它类似于一些段落的组合。
例如,
我必须将该字符串变量制作成这种形式:
此文段的翻译如下:
Passages provides funeral and burial products.
Our products are meant to align with your values and bring you comfort.
Our products allow you to offer personalization , flexibility and innovative choices, helping you provide services to a wider range of customers.
我必须将该字符串变量制作成这种形式:
Passages provides funeral and burial products. Our products are meant to align with your values and bring you comfort. Our products allow you to offer personalization, flexibility and innovative choices, helping you provide services to a wider range of customers.
此文段的翻译如下:
此外,单词之间的额外空格需要移除(或在句点和单词的第一行之间的空格),并转换为一个空格。另外,任何在“,”、“。”或“;”之前的多余空格也需要被移除。
我是Java的新手,请问有人能告诉我应该如何实现吗?