How to replace underscores with spaces?

You can replace all underscores in a string with a space like so:

str.replace(/_/g, ' ');

So just do that before the content is put in. If you need to perform the replacement afterwards, loop using each:

$('.name').each(function () {
    this.textContent = this.textContent.replace(/_/g, ' ');
});

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)