create some strings : String : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » String »

 

create some strings








    
 

using System;

class MainClass {

    public static void Main() {
        
        string myString = "To be or not to be";
        string myString2 = "...\t that is the question";
        string myString3 = @"\t Friends, Romans, countrymen,
lend me your ears";

        // display the strings and their Length properties
        Console.WriteLine("myString = " + myString);
        Console.WriteLine("myString.Length = "
          + myString.Length);
        Console.WriteLine("myString2 = " + myString2);
        Console.WriteLine
         ("myString2.Length = " + myString2.Length);
        Console.WriteLine("myString3 = " + myString3);
        Console.WriteLine
          ("myString3.Length = " + myString3.Length);    
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» String