docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class StringExtensions

    Extension methods for strings.

    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.AppUI.Core
    Assembly: Unity.AppUI.dll
    Syntax
    public static class StringExtensions

    Methods

    Capitalize(string)

    Capitalizes the first letter of a string.

    Declaration
    public static string Capitalize(this string arg)
    Parameters
    Type Name Description
    string arg

    The string to capitalize.

    Returns
    Type Description
    string

    The capitalized string.

    GetInitials(string)

    Gets the initials from a name string.

    Declaration
    public static string GetInitials(this string name)
    Parameters
    Type Name Description
    string name

    The name to extract initials from.

    Returns
    Type Description
    string

    The uppercase initials: first letter of the first two words for multi-word names, first two characters for single-word names with 2+ characters, the single character for one-character names, or "?" if the string is null or empty.

    In This Article
    Back to top
    Copyright © 2026 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)