Hi I have a string like below:
>123456<
How can I easily replace the angle brackets and replace them with blank?
I have tried the below:
mystring.replace(/>/g, "");
mystring.replace(/</g, "");
However if I do an alert(mystring);
on this it is still showing with the angle brackets?
You need to assign, in this case, mystring
with the result of the operation.
var s = '>123456789<';
s = s.replace(/[<>]/g, '');
alert(s);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With