String is object : String : String C# Examples


C# Examples » String » String »

 

String is object









    
using  System;

class  MainClass
{
        static  void  Main(string[]  args)  {
                string  strOriginal  =  "Original  String";
                Console.WriteLine(  "Value  of  strOriginal  before  call:  {0}",  strOriginal  );

                TryToAlterString(  strOriginal  );

                Console.WriteLine(  "Value  of  strOriginal  after  call:  {0}",  strOriginal  );
        }

        static  void  TryToAlterString(string  str)  {
                str  =  "Modified  String";
        }
}
    
   
  
   



Output

Value of strOriginal before call: Original String
Value of strOriginal after call: Original String


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» String