Trim   and <br> tags from String java or javascript - Stack Overflow

I want to remove starting and trailing br and nbsp tags from a string using java or javascript.Input an

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 badges
Add a ment  | 

1 Answer 1

Reset to default 8

Something like this?

request.replace(/^\&nbsp\;|<br?\>*/gi, "").replace(/\&nbsp\;|<br?\>$/gi, "").trim();

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745479298a4629491.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信