2
String s = "You should always brush your teeth before every meal in the day.";
但我希望做的是分裂部成新句子,像這樣:
String s = "You should always brush your teeth/nbefore every meal in the day.";
所以結果是這樣的:
String s = "You should always brush your teeth";
String s2 = "before every meal in the day.";
基本上,我希望它搜索「/n」,然後將下一句與現在分開。
分裂的第二個字符串是容易的。但是如果你想分割第一個字符串,這被稱爲* word wrapping *,這是一個完全不同的主題。 –