title: Insert string into a filepath string before the file extension C#
body: <p>I have a string that defines the path of a file:</p>
  
  <pre><code>string duplicateFilePath = D:\User\Documents\processed\duplicate_files\file1.jpg;
  </code></pre>
  
  <p>I am going to move a file to this location but sometimes a file with the identical name exists all ready. In this case I want to differentiate the filename. I have the crc value of each file available so I figured that may be good to use to ensure individual file names. I can create:</p>
  
  <pre><code>string duplicateFilePathWithCrc = duplicateFilePath + "(" + crcValue + ")";
  </code></pre>
  
  <p>But this gives:</p>
  
  <pre><code>D:\User\Documents\processed\duplicate_files\file1.jpg(crcvalue);
  </code></pre>
  
  <p>and I need:</p>
  
  <pre><code>D:\User\Documents\processed\duplicate_files\file1(crcvalue).jpg;
  </code></pre>
  
  <p>How can I put the crcvalue into the string before the file extension, bearing in mind there could be other .'s in the file path and file extensions vary?</p>