JSFiddle - React, Tailwind, and code Playground

JavaScript

String.prototype.strip = function() {
  var translate_re = /[öäüÖÄÜß ]/g;
  var translate = {
    "ä":"a", "ö":"o", "ü":"u",
    "Ä":"A", "Ö":"O", "Ü":"U",
    " ":"_", "ß":"ss"   // probably more to come
  };
    return (this.replace(translate_re, function(match){
        return translate[match];})
    );
};
var teststring = 'ä ö ü Ä Ö Ü ß';
var newstring = teststring.strip();
console.log(newstring);