Remove string from a string jquery

javascript, jquery, replace, string

Solution

Your problem is that `replace` does not replace the characters in your original string but returns a new string with the replacement.

myString = myString.replace(avoid,'');

Problem

I am trying to replace within a string using jquery ``` var myString ="qwerty" var avoid ="t" ``` I want to do someting like ``` myString.replace(avoid,''); ``` I was able to remove like `myString.replace('t','');` But i want it to be like `myString.replace(avoid,'');` How to do it? JsFiddle : http://jsfiddle.net/nKSZT/

Original source