How do i do this? I tried something like this but I do not seem to be able to get any further.
public void speak(String text)
{
String[] textArray = text.spl
Is it possible with regular expression, it needs less code:
Pattern p=Pattern.compile("[\\s\\S]{99}");
Matcher matcher = p.matcher(s);
ArrayList list= new ArrayList<>();
int lastFound=0;
while (matcher.find()){
list.add(matcher.group()+" ");
lastFound = matcher.end();
}
list.add(s.substring(lastFound));
If you mean something else just comment! May be you need to add more patterns in your string has tabs, new line and other special chars.