docs.unity.cn
    Show / Hide Table of Contents

    Class StringExtensions

    Set of utility functions with String

    Inheritance
    System.Object
    StringExtensions
    Namespace: UnityEditor.Rendering
    Syntax
    public static class StringExtensions

    Methods

    HasExtension(String, String)

    Checks if the given string ends with the given extension

    Declaration
    public static bool HasExtension(this string input, string extension)
    Parameters
    Type Name Description
    String input

    The input string

    String extension

    The extension

    Returns
    Type Description
    System.Boolean

    True if the extension is found on the string path

    ReplaceInvalidFileNameCharacters(String, String)

    Replaces invalid characters for a filename or a directory with a given optional replacemenet string

    Declaration
    public static string ReplaceInvalidFileNameCharacters(this string input, string replacement = "_")
    Parameters
    Type Name Description
    String input

    The input filename or directory

    String replacement

    The replacement

    Returns
    Type Description
    String

    The string with the invalid characters replaced

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on 07 July 2023