Wednesday 13 March 2019

string format in C#

 public string GetDetails()
        {
            return string.Format("{0} - {1} - {2}", Name, Role, PreferredLanguage, Projects);
        }

public string GetDetails()
{
    return ($"The value of  ({Name},{Role}) and ({PreferredLanguage},{Projects})");
}

No comments:

Post a Comment