JSFiddle - React, Tailwind, and code Playground

by ten1seven

JavaScript

String.prototype.alphaNumeric = function () {
    return this.replace(/[^a-zA-Z 0-9]+/g, "");
};
    
// Test output
var temp = 'This is a test string... So??? What...';
document.write( temp.alphaNumeric() );