From http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx, We know Windows reserve some characters:
< (less than)
> (greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)
I have a file name which contains come of those special characters,
I want to replace those with "",
something like this (string.replace(/\<>/g, '')
Thanks
In both NTFS and FAT file systems, the special file name characters are: '\', '/', '. ', '?' , and '*'. On OEM code pages, these special characters are in the ASCII range of characters (0x00 through 0x7F).
You can put all those characters inside a character set:
string.replace( /[<>:"\/\\|?*]+/g, '' );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With