java - removing invalid characters (("\\/:*?\"<>|") ) from a string to use it as a FileName -


how remove invalid characters string , can used file name ?
invalid characters include ("\\/:*?\"<>|").

you can try this,

string filename = "\\/:*aaaaa?\"<>|3*7.pdf"; string invalidcharremoved = filename.replaceall("[\\\\/:*?\"<>|]", ""); system.out.println(invalidcharremoved); 

output

aaaaa37.pdf 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

javascript - How to process users in one specific order using map o each function? -

javascript - Linking from page A to a specific iframe on page B -