Click here to Skip to main content
15,893,722 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
Hey guys


I wanna know what does zero this part {0} do in this method ???


C#
public string HelloUser(string Name)
      {
          return string.Format("Hello {0}", Name);
      }
Posted
Comments
Zoltán Zörgő 21-Jun-13 15:26pm    
Run and see for yourself.

Its a place holder that the "Name" variable gets placed at run time. You can add additional parameters by using {1}, {2}, etc.
 
Share this answer
 
Try reading the documentation on String.Format[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900