[opensuse] Re: [Mono-list] Creating file name from string



Andrus wrote:
I need to create legal file name form any string so that PDF and other
viewers show nice title.

This code should create legal file name in every platform supported by MONO
and .NET

I created method LegalFileName() for this which uses 2 helper methods.
It replaces <>\/:?*"| characters in name.

In the System.IO.Path class, there's an InvalidFilenameCharacters property and InvalidPathCharacters, that should provide you with the characters you can't use on a given system.

I haven't worked much with mono yet, but I'm guessing that System.IO.Path is probably fully implemented, and well tested.
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx