string method remove all characters before and after strings javascript code example Example: javascript remove character from string mystring.replace(/r/g, '')