I need to convert a sub-string of a string with a character in javascript.
I used following code to do that
av_text_to_display = av_text_to_display.replace("a*^!", "'");
but it can only replace first occurrence. I used following code for all occurrences
av_text_to_display = av_text_to_display.replace("a*^!", "'", "g");
but it is not a standard way. What is the standard way to do that?