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, "_" );}
Wednesday, May 4, 2011
Removing invalid characters from file name and making file valid.
Subscribe to:
Post Comments (Atom)
Featured Posts
🚀 The Ultimate Guide to Running Local LLMs on Any PC
A Practical, Step-by-Step Guide to Running AI Models Locally 📖 Introduction What Are Large Language Models (LLMs)? Large Language Models ar...
-
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)...
Where do Regex, Path come from?
ReplyDelete