Agile Web Development

Build it. Launch it. Love it.

Word Breaker

This means without using a HTML parser it will insert tags thereby enabling wordwrap in most modern browsers
Example
test = “averylongtexttobebrokeninsetoffive”
calling wordwrap(test, 5)
outputs:
avery
longt
extto
bebro
kenin
setof
five

Vitals

Home http://abhijat.name
License GPL
Tags Tag_red ruby wbr word word_breaker
Rating (9 votes)
Owner Abhijat
Created 18 June 2008

Comments

  • Avatar
    Ryan
    4 August 2008

    Awesome work i really appreciate the work behind the reg exps there. It would have taken me a while to do the same. Thanks Ryan

  • Avatar
    22 April 2009

    This is really good specially saving me all the parsing.

    wbr is a good solution for me

Add a comment