Class FileUtil
Provides utility methods for file path management and validation.
Inherited Members
Namespace: TriLibExporter
Assembly: Assembly-CSharp.dll
Syntax
public static class FileUtil
Methods
GetFileExtension(string, bool)
Gets the given file extension.
Declaration
public static string GetFileExtension(string path, bool includeDot = true)
Parameters
Type | Name | Description |
---|---|---|
string | path | The file name. |
bool | includeDot | If |
Returns
Type | Description |
---|---|
string | The filename extension. |
GetFilename(string)
Gets the file name from the given path.
Declaration
public static string GetFilename(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The full file path. |
Returns
Type | Description |
---|---|
string | The filename. |
GetFilenameWithoutExtension(string)
Gets the given file name without the extension.
Declaration
public static string GetFilenameWithoutExtension(string filename)
Parameters
Type | Name | Description |
---|---|---|
string | filename | The full filename. |
Returns
Type | Description |
---|---|
string | The filename without extension. |
SanitizePath(string)
Sanitizes a file path by removing invalid characters and replacing directory separators.
Declaration
public static string SanitizePath(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The file path to sanitize. |
Returns
Type | Description |
---|---|
string | A sanitized version of the file path. |