Javascript to remove trailing  

Posted by ria on Stack Overflow See other posts from Stack Overflow or by ria
Published on 2010-06-08T06:26:58Z Indexed on 2010/06/08 6:32 UTC
Read the original article Hit count: 102

Filed under:

I am getting a string which is nothing but innerHTML, and so it has instances of  . I need to trim the string such that the trailing   alone are removed. Tried this:

var text;
text = txtInnerHTML.replace(/( )*/g,"");

This removes all instances of   which is not desired.. Only the trailing   need to be removed.

© Stack Overflow or respective owner

Related posts about JavaScript