use the Substring() method to retrieve substrings : String : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » String »

 

use the Substring() method to retrieve substrings








    
 

using System;

class MainClass {

    public static void Main() {

        string[] myStrings = {"To", "be", "or", "not","to", "be"};
        string myString = String.Join(".", myStrings);        

        string myString21 = myString.Substring(3);
        Console.WriteLine("myString.Substring(3) = " + myString21);
        string myString22 = myString.Substring(3, 2);
        Console.WriteLine("myString.Substring(3, 2) = " + myString22);

        string myString23 = myString.ToUpper();
        Console.WriteLine("myString.ToUpper() = " + myString23);
        string myString24 = myString.ToLower();
        Console.WriteLine("myString.ToLower() = " + myString24);

    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» String