Skip to navigation
Cleanup strings for filenames in javascript
24.08.21
Cleanup strings for filenames in javascript function filenamer(_name) { let value = _name.toLowerCase(); value = value.replace(/ä/g, 'ae'); value = value.replace(/ö/g, 'oe'); value = value.replace(/ü/g, 'ue'); value = value.replace(/ß/g, 'ss'); value = value.replace(/ & /g, '_and_'); value = value.replace(/ /g, '_'); value = value.replace(/\./g, ''); value = value.replace(/,/g, ''); value = value.replace(/\(/g, ''); value = value.replace(/\)/g, ''); value = value.replace(/[^a-zA-Z0-9-_]/g, ""); return value; }
https://stackoverflow.com/questions/11652681/replacing-umlauts-in-js
Reply
Anonymous
Information Epoch 1732533790
Small is beautiful.
Home
Notebook
Contact us