docs.unity.cn
    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 © 2020 Unity Technologies
    Generated by DocFX
    on Thursday, October 28, 2021