docs.unity3d.com
    Show / Hide Table of Contents

    Default source

    The default source replicates the String.Format behavior and extracts an argument by the index.

    The default source examines the current selector. If the selector can be parsed as an integer and is a valid index (within the number of provided arguments), the default source extracts the argument at the selected index and no further selectors are considered.

    Example Smart String Arguments Result
    {0} {1} {2}
    1, 2, 3
    
    1 2 3
    {1} {1} {2} {0}
    1, 2, 3
    
    2 2 3 1
    Player {0} scored {1} points
    "Potato", 155
    
    Player Potato scored 155 points
    Player {0:Name} score {0:Points}
    new { Name = "One", Points = 100 }
    
    Player One Scored 100 points
    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