docs.unity3d.com
    Show / Hide Table of Contents

    Class StringExtensions

    Extension methods for System.String.

    Inheritance
    Object
    StringExtensions
    Namespace: Unity.Tutorials.Core.Editor
    Syntax
    public static class StringExtensions : object

    Methods

    AsEmptyIfNull(String)

    Returns an empty string ("") if this string is null.

    Declaration
    public static string AsEmptyIfNull(this string self)
    Parameters
    Type Name Description
    String self
    Returns
    Type Description
    String

    AsNullIfEmpty(String)

    Returns null if this string is null or an empty string ("").

    Declaration
    public static string AsNullIfEmpty(this string self)
    Parameters
    Type Name Description
    String self
    Returns
    Type Description
    String

    AsNullIfWhiteSpace(String)

    Returns null if this string is not null, empty, or consists only of white-space characters.

    Declaration
    public static string AsNullIfWhiteSpace(this string self)
    Parameters
    Type Name Description
    String self
    Returns
    Type Description
    String

    IsNotNullOrEmpty(String)

    Indicates whether this string is not null or an empty string ("").

    Declaration
    public static bool IsNotNullOrEmpty(this string self)
    Parameters
    Type Name Description
    String self
    Returns
    Type Description
    Boolean

    IsNotNullOrWhiteSpace(String)

    Indicates whether this string is not null, empty, or consists only of white-space characters.

    Declaration
    public static bool IsNotNullOrWhiteSpace(this string self)
    Parameters
    Type Name Description
    String self
    Returns
    Type Description
    Boolean

    IsNullOrEmpty(String)

    Indicates whether this string is null or an empty string ("").

    Declaration
    public static bool IsNullOrEmpty(this string self)
    Parameters
    Type Name Description
    String self
    Returns
    Type Description
    Boolean

    IsNullOrWhiteSpace(String)

    Indicates whether this string is null, empty, or consists only of white-space characters.

    Declaration
    public static bool IsNullOrWhiteSpace(this string self)
    Parameters
    Type Name Description
    String self
    Returns
    Type Description
    Boolean
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023