TriLib Exporter
Search Results for

    Show / Hide Table of Contents

    Class FileUtil

    Provides utility methods for file path management and validation.

    Inheritance
    object
    FileUtil
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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 true, includes the dot (.) in the result.

    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.

    In this article
    Back to top Generated by DocFX