Method: TrimAsFileName( … )

Returns a new string by removing any characters that are not valid to use in filenames.

Syntax

string TrimAsFileName( object content, bool includeExtension = false )

Example

var myName = "Name*Of<File.txt"; Name = TrimAsFileName( myValue ); // Name is now "NameOfFile"