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
🌫️ Project Title: "Fog Buster – AI-Powered Visibility Enhancement System"
🔍 Project Vision: To design a device that allows vehicles (cars, trucks) and aircraft (planes, helicopters, drones) to see clearly during f...
-
Configuration config = HBaseConfiguration.create(); Job job = new Job(config,"ExampleReadWrite"); job.setJarByClass(MyReadWriteJo...
-
All data is retrieved through a WitsmlServer instance which represents the WITSML server in the client program. There are three differe...
Where do Regex, Path come from?
ReplyDelete