Here is a function which take a long String and return a string divided in paragraph.
The problem is that k is empty. Why split()
function doesn't work?
private String ConvertSentenceToParaGraph(String sen) {
String nS = "";
String k[] = sen.split(".");
for (int i = 0; i < k.length - 1; i++) {
nS = nS + k[i] + ".";
Double ran = Math.floor((Math.random() * 2) + 4);
if (i > 0 && i % ran == 0) {
nS = nS + "\n\n";
}
}
return nS;
}