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 -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -