private static string CreateValidFileName( string Filename )
{string invalidChars = Regex.Escape( new string( Path.GetInvalidFileNameChars() ) );
string invalidReStr = string.Format( @"[{0}]+", invalidChars );
return Regex.Replace( Filename , invalidReStr, "_" );}
All the question that scared me now i am trying to scare them .. so that they cant scare others :)
Wednesday, May 4, 2011
Removing invalid characters from file name and making file valid.
Subscribe to:
Post Comments (Atom)
Featured Posts
Warp AI Terminal 🔥 | The Future of Coding? Agentic Dev Environment Explained!
Warp AI Terminal 🔥 | The Future of Coding? Agentic Dev Environment Explained! What if your terminal could think, assist, and even act li...
-
Use the following function which is built in percentile(BIGINT col, p) and set p to be 0.5 and will calculate the median credit : ...
-
Adding Project Items The following tables list the available project items for local and Web projects. Note that for some project items, th...
Where do Regex, Path come from?
ReplyDelete