JSFiddle - React, Tailwind, and code Playground

by dustinpoissant

JavaScript

String.prototype.lettersOnly = function(){
    return this.replace(/[\.,-\/#!$|%\^&\*;:{}=\-_`~()]/g,"").replace(/[0-9]/g, '');
}
var s = "string&#123\54;|.";
alert(s.lettersOnly());