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

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT

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);





Input String is =Helow World


Further Readings:


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