/**
* @author matthew_hicks
*/
public class Utils {
public static final String breakLinesHTML(String s, int width) {
if (s == null) return null;
StringBuffer buffer = new StringBuffer();
buffer.append("");
int p = 0;
char c;
for (int i = 0; i < s.length(); i++) {
c = s.charAt(i);
if (((p >= width) && (c == ' '))||(c == '\n')) {
buffer.append("
");
p = 0;
} else {
buffer.append(c);
}
p++;
}
buffer.append("");
return buffer.toString();
}
}