Discussion Forums
- Topic List
- Most Recent Posts
- Sign In for more options
Hi I want to truncate html_text Here in may application am saving headlines into databse, for this am using fckeditor.So i can select htmltags for headlines formatting.
In another page am displaying headlines in one div .But div can show only 10 chars.So am truncating text to 10 by using truncate method.but the prblm is in my headlines have htmltags only for 10 chars then there is nothing to display. So i want to truncate only charcters withou consider htmltags,but whiledispalying it should be with htmltags. Can anybody help .How to solve this.
It's very urgent.Any sugestions will be appriciate
Apply this regexp first:
str = "This and that and
and the other?"
puts str.gsub(/]*>/, "")
