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 :)
Showing posts with label validate file name. Show all posts
Showing posts with label validate file name. Show all posts
Wednesday, May 4, 2011
Removing invalid characters from file name and making file valid.
Subscribe to:
Posts (Atom)
Featured Posts
How to Enable and Configure Remote Desktop (RDP) on Ubuntu 24.04.4 LTS
Remote Desktop Protocol (RDP) support in Ubuntu has become considerably easier with the GNOME Remote Desktop stack included in modern Ubuntu...
-
public struct CoOrds { public int x, y; public CoOrds( int p1, int p2) { x = p1; y = p2; } }
-
LM Studio Overview LM Studio is a desktop application designed for developing and experimenting with large language models (LLMs)...