Splitting strings by | : String Split Join : String C# Examples


C# Examples » String » String Split Join »

 

Splitting strings by |









    
using  System;
using  System.Collections.Generic;
using  System.Globalization;
using  System.IO;
using  System.Text;

public  class  MainClass
{
        public  static  void  Main()
        {
                string  s  =  "J|M|P|C";
                string[]  pieces  =  s.Split('|');
                foreach  (string  piece  in  pieces)
                {
                        Console.WriteLine(piece);
                }
        }
}
    
   
  
   



Output

J
M
P
C


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» String Split Join