Spliting string with a string value in c#

The String.Split method returns an array of the substrings in a given string that are delimited by specified strings.
  1. using System;    
  2. using System.Collections.Generic;  // Only if you are using List<> in below example  
  3.     
  4. namespace ConsoleApplication1    
  5. {    
  6.     public class MyClass    
  7.     {    
  8.         /// <summary>    
  9.         /// Using String.Split Method we will try to retrieve given string without delimiter value    
  10.         /// (delimiter: Means one which determine the limits or boundaries of something    
  11.         /// in this case query string word "where")    
  12.         /// and later in code we will return only Delimiter value i.e. "where".    
  13.         /// </summary>    
  14.     
  15.         //Program Entry    
  16.         static void Main()    
  17.         {    
  18.             //Sample query string "myQuery"    
  19.             //Here we are using "where" as delimiter value    
  20.             //Our objective is to retrieve below string without "where" string.    
  21.             string myQuery = "select * from Customer where Cust_id=786";    
  22.                 
  23.             //---------------------------------------------------------    
  24.             //Array in which we will collect our string without delimiter (i.e. "where")    
  25.             string[] result;  // OR List<string> result;// Also you can use generics List<> to     
  26.             //collect return set of strings.    
  27.                
  28.             //---------------------------------------------------------    
  29.             //Here Overload of Split method is used with parameter "where"    
  30.             result = myQuery.Split(new string[] { "where" }, StringSplitOptions.None);    
  31.             //OR    
  32.             //result = myQuery.Split(new string[] { "where" }, StringSplitOptions.None).ToList();     
  33.             //If you are using generic list e.g.List<string> as above option.    
  34.     
  35.             //As non of our returned arrays/list (e.g. result[0] and result[1])     
  36.             //contains empty string(s) in them we have selected     
  37.             //StringSplitOptions.None but if you suspect that there can be empty string then use     
  38.             //StringSplitOptions.RemoveEmptyEntries    
  39.                 
  40.             //---------------------------------------------------------    
  41.             //formatting outing by collecting 'result' array into str string    
  42.             //this step is required only for demonstration purpose of output    
  43.             string str = "";    
  44.             foreach (string s in result)    
  45.                 str += s.Trim() +"\n";    
  46.                 
  47.             //---------------------------------------------------------    
  48.             Console.WriteLine("{0}", str);    
  49.             //Press Ctrl + F5: For Output.    
  50.             //OUTPUT    
  51.             //  select * from Customer    
  52.             //  Cust_id=786    
  53.                 
  54.             //---------------------------------------------------------    
  55.             //result[0] stores "select * from Customer" as string value    
  56.             //retult[1] stores "Cust_id=786" as string value    
  57.             Console.WriteLine("Result[0]= {0},\nResult[1]= {1}", result[0], result[1]);    
  58.                 
  59.             //---------------------------------------------------------    
  60.             //OUTPUT    
  61.             //Result[0]= select * from Customer ,    
  62.             //Result[1]=  Cust_id=786    
  63.                 
  64.             //End of Program    
  65.                 
  66.         }    
  67.             
  68.     }    
  69. }