![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
03/09/2013, 19:56
|
![Avatar de ONahuelO](http://static.forosdelweb.com/customavatars/avatar308933_1.gif) | | | Fecha de Ingreso: junio-2009 Ubicación: Gualeguaychú, Argentina
Mensajes: 144
Antigüedad: 15 años, 7 meses Puntos: 4 | |
Respuesta: Insertar <br> cada x caracteres Solucion:
Código:
function wordwrap( str, width, brk, cut ) {
brk = brk || '\n';
width = width || 75;
cut = cut || false;
if (!str) { return str; }
var regex = '.{1,' +width+ '}(\\s|$)' + (cut ? '|.{' +width+ '}|.+$' : '|\\S+?(\\s|$)');
return str.match( RegExp(regex, 'g') ).join( brk );
}
Nose de quien es, la encontre en google. |