[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@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Jerry Houston wrote:
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.
Please ignore - was supposed to go to the mono list. My bad. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (1)
-
Jerry Houston