Is there a standard way to do this? My popup window has maxsize and I would like to cut the string if it is too long. Currently I'm doing
if(txt.length()>320)
{
txt = txt.substring(0,320)+"...";
}
but this seems crude and doesn't work sometimes because of paragraphs.