Hi! I am trying to print a string across multiple lines. Each line has 23 characters. The string will be appended to an email
emessg.append (title.substring(0,23)).append("\t\t"); //this prints the first line , and I will add something after that
But the real problem is here int i=0; int j=23; while(j<title.length()) { i=j; j=i+23; if(j>title.length()) j=title.length(); emessg.append("\t\t\t").append(title.substring(i,j)).append("\n"); }
The code works fine but the string is not getting wrapped up. Suppose if I have a word "World" at the end it is printed as Worl d But I need the word in the same line. How do I do this? Any suggestions