docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class StringExtensions

    Extension methods for string objects.

    Inheritance
    object
    StringExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.XR.CoreUtils
    Assembly: Unity.XR.CoreUtils.dll
    Syntax
    public static class StringExtensions

    Methods

    FirstToUpper(string)

    Capitalizes the first letter of a string.

    Declaration
    public static string FirstToUpper(this string str)
    Parameters
    Type Name Description
    string str

    String to be capitalized.

    Returns
    Type Description
    string

    The new string.

    InsertSpacesBetweenWords(string)

    Inserts spaces into a string between words separated by uppercase letters. Numbers are treated as uppercase.

    Declaration
    public static string InsertSpacesBetweenWords(this string str)
    Parameters
    Type Name Description
    string str

    Input string.

    Returns
    Type Description
    string

    Input string with spaces added.

    Remarks

    Examples:

    • "HelloWorld" -> "Hello World"
    • "HelloWORLDAgain" -> "Hello WORLD Again"
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)