anna
anna

Reputation: 93

how to replace 
 with empty string

I am trying to display outout of html instead of html tags so I used this regular expression.

String(text).replace(/<[^>]+>/gm, ''); 

To replace the html tags and it removed all the html tags but I still have & # 10; in the text.

I guess it is for the new line character .

How do I escape it?

& # 10;& # 10;& # 10;& # 10;& # 10;& # 10;& # 10;& # 10;& # 10; Where: Access code: 0164 125 followed by the # sign.& # 10; Review& # 10;- New Template PRE DR template v03.xlsx& # 10;- Information Regarding the change& # 10;- Documentacion description Functionality, incidents and project code. - Delivery software - Test

Upvotes: 1

Views: 197

Answers (1)

&#198;dx
&#198;dx

Reputation: 84

Just use the following code:

var text = "A string to have & # 10; removed"
text.replace(/& # 10;/g, ""); //Returns "A string to have  removed"

Note that the multi-line modifier (m) is not necessary.

Upvotes: 1

Related Questions