I am trying to remove these special chars from a string < > : ; / ,
const afterReplace = fileName.replace(/[;:,<>\]/g, '');
This is working for all chars but for forward slash.
If I add forward slash in this (/[;:,<>/\]/g, '')
and pass string 'Special/Name'
. My output is just 'Special'
. It truncates all chars after /.
const fileName = 'Special/Name'
const afterReplace = fileName.replace(/[;:,<>/\]/g, '');
console.log(afterReplace)