remove prefix from string javascript code example Example: remove prefix js str.replace(/^myPrefix/,"");