Use the Split() method to split strings : String : String C# Examples


C# Examples » String » String »

 

Use the Split() method to split strings









    
using  System;

class  MainClass
{

    public  static  void  Main()
    {
        string[]  myStrings  =  {"To",  "be",  "or",  "not",  "to",  "be"};
        string  myString9  =  String.Join(".",  myStrings);        
        myStrings  =  myString9.Split('.');
        foreach  (string  mySplitString  in  myStrings)
        {
            Console.WriteLine("mySplitString  =  "  +  mySplitString);
        }
    }

}
    
   
  
   



Output

mySplitString = To
mySplitString = be
mySplitString = or
mySplitString = not
mySplitString = to
mySplitString = be


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» String