Pages

Wednesday, January 25, 2012

Pass arguments to String.Format method in c#

Pass arguments to String.Format method in c# 

Introduction : In this article i will show you how to pass the arguments to String.Format method in c# . You need to pass comma separated list of arguments to the string.Format method .There must be argument for each of the place holders .

Following is the example of String.Format in c# :
 
 string Name ="Seta Hamid ";
 string Country ="India";          
 Response.Write( String.Format("My Name is {0}. I am from {1}.", Name, Country));

Output of the string.Format C#.
 
My Name is Seta Hamid . I am from India. 


Related Other posts