remove a character from string function in javascript code example Example: javascript remove character from string mystring.replace(/r/g, '')