Forum: Ruby-Forum.com how to truncate special charactors

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3548d30217e9921c410db19ce8ce38d0?d=identicon&s=25 Sunny Bogawat (sunny_bogawat)
on 2008-09-18 12:14
Hi,
   In my application I am using a list box where i am showing different
groups
   name. I am using
<%=truncate_html_strip_textual_wrap(group.name,28,28)%>
   for truncating the name but it gives me problem when group name come
   like Shital's friends from "Office" Group this

    In list box it showing as a Shital's friends from & quote..
    how to avoid such a thing? whats a proper way for handling such a
situations?

  character like single quote, double quote, ampersand not truncated
properly
  please give me a standers way for doing it.
This topic is locked and can not be replied to.