title: looking for elegant way to get sub string
body: <p>I have a bunch of string like below,</p>
  
  <pre><code>var myString = "ABC.XYZ.GrabIt.Delimator.Hello1.Hello2";
              //var myString = "ABC.XYZ.PQR.GrabIt.Delimator.Hello1.Hello2.Hello3";
              //var myString = "ABC.GrabIt.Delimator.Hello1";
  </code></pre>
  
  <p>Over here I need substring before the string <code>.Delimator</code> and after the immediate dot, I need only output as <code>GrabIt</code>.</p>
  
  <p>I did below try, where I'm splitting the string with value <code>Delimator</code> and then trying to grab the string between last 2 dot. looking for a elegant way to do the same? Thanks, </p>
  
  <pre><code>var referrer = myString.Split(new[] { "Delimator" }, StringSplitOptions.None)[0];
  
              referrer = referrer.Substring(referrer.Substring(0, referrer.LastIndexOf(".")).LastIndexOf(".") + 1).TrimEnd('.');
  </code></pre>