9
rated 0 times
[
14]
[
5]
/ answers: 1 / hits: 27173
/ 7 Years ago, mon, may 15, 2017, 12:00:00
I'm having the below string in my node js.
var textToReplace = Your <b class =b_1>1</b> payment due is $4000.Your
<b class =b_1>2</b> payment due is $3500. Your <b class =b_1>3</b>
payment due is $5000.;
Here I want to replace <b class =b_1>*</b>
with ''
. The output is Your 1 payment due is $4000.Your 2 payment due is $3500. Your 3 payment due is $5000.
.
If this is a normal replace I wouldn't have had any problem, but here I think the best way to replace is by using Regex. This is where I'm confused. In java we have a stringVariableName.replaceAll()
method. please let me know how can I do this.
Thanks
More From » node.js