title: Using RegEx to Split the Url
body: <p>I want to Split the url into two part using RegEx. I have saved the xml response into datatable and iterate through the each row using foreach. When I use the datatable value for regEx only 0 will be available. When I use the array index 1 it give the following Exception.</p>
  
  <pre><code>System.IndexOutOfRangeException: Index was outside the bounds of the array.
  </code></pre>
  
  <p>The Following is gives and Exception.</p>
  
  <pre><code>foreach (DataRow row in ndt.Rows)
  {
      string imgurl =row["image1"].ToString();
  
      String[] fimgurl = Regex.Split(imgurl, @"small/");
      String  simgurl = fimgurl[1];
  }
  </code></pre>
  
  <p>The Following It's working without any issue.</p>
  
  <pre><code>foreach (DataRow row in ndt.Rows)
  {
      //TextBox1.Text = row["ImagePath"].ToString();
      string imgurl ="http://www.hotelbeds.com/giata/small/12/124356/124356a_hb_w_001.jpg";
      String[] fimgurl = Regex.Split(imgurl, @"small/");
      String  simgurl = fimgurl[1];
  }
  </code></pre>
  
  <p>I Have saved  the same url as string in My Datatable. I couldn't find what's wrong with that. Can anyone please help me on this?</p>