Declaration of string : String : String C# Examples


C# Examples » String » String »

 

Declaration of string






strings are objects.
string is a reference type.


static string Copy(string str)
int CompareTo(string str)
int IndexOf(string str)
int LastIndexOf(string str)
string ToLower( )
string ToUpper( )

A string is a set of characters enclosed by double quotes. For example,




    
"this  is  a  test"
    
   
  
   

is a string.




    
using  System;

class  MainClass
{
    static  void  Main(string[]  args)
    {
        string  MyString  =  "Hello  World";
        string  Path  =  @"c:\Program  Files";
        string  Path2  =  "c:\\Program  Files";

        string  Name  =  "Joe";

    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» String