.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

Return String Function

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

The Following code snippest shows you how to pass a string parameter and return a string output.
 

class Program

       string strname = "Helow World";

       public string strfunction(string input)

      {

         string strmessage = input;

         return strmessage;

       }

   static void Main(string[] args)

  {

   Program p = new Program();

   string str = p.strfunction(p.strname );

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

    Console.Read();

   }

}

Output:-

Input String is =Helow World


     

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