.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> OOPS >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

pass string array to function

Posted By:Syed Shakeer Hussain       Posted Date: September 19, 2010    Points: 10    Category: OOPS    URL: http://www.dotnetspark.com  

Passing String Array to Function using C#.net
 

class Program

{

      string[] strname = { "Helow World","Shakeer","Hussain" };

      public string strfunction(string input)

     {

           string strmessage = input;

           return strmessage;

      }

     static void Main(string[] args)

     {

          Program p = new Program();

          for (int i = 0; i < p.strname.Length; i++)

          {

               string str = p.strfunction(p.strname[i]);

              Console.WriteLine("Input String is ="+str );

          }

           Console.Read();

     }

}


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend