title: Trim string if a string ends with a specific word
body: <p>I need to trim strings if there is a word <code>where</code> coming at the end of string. What is the fast performing approach in C# for this?</p>
  
  <p>Note: The word to trim can be anything.. <code>WHERE</code> is just an example</p>
  
  <pre><code>string text1 = "My hosue where sun shines";  //RESULT: "My hosue where sun shines"
  string text2 = "My where"; //RESULT: "My"
  string text3 = "My where I WHERE"; //RESULT:"My where I"
  </code></pre>