How can I turn this "- | " into "-" with jQuery?
.replace(/__-__ | /g, '__-__'
This also replaces the empty spaces
.replace('__-__ | ', '__-__'
This only replaces the first time it occurs
How can I turn this "- | " into "-" with jQuery?
.replace(/__-__ | /g, '__-__'
This also replaces the empty spaces
.replace('__-__ | ', '__-__'
This only replaces the first time it occurs
Not sure why you're attempting this in jQuery. String replace is a javascript string method unless you're talking about replacing DOM elements.
input.replace(/- \|/g, '-_-');
You answer helpt me out! :)
.replace(/__-__ \|/g, '__-__')
This worked just great! Thanx!