I want to remove starting and trailing br and nbsp tags from a string using java or javascript.
Input and desired output are hosted in jsfiddle because Stackoverflow is not letting me to post html content.
/
I want to remove starting and trailing br and nbsp tags from a string using java or javascript.
Input and desired output are hosted in jsfiddle because Stackoverflow is not letting me to post html content.
http://jsfiddle/HwDf9/
Share Improve this question asked Sep 9, 2011 at 10:41 sathissathis 5471 gold badge3 silver badges21 bronze badges1 Answer
Reset to default 8Something like this?
request.replace(/^\ \;|<br?\>*/gi, "").replace(/\ \;|<br?\>$/gi, "").trim();