title: Split an irregular string into key-value pairs
body: <p>I have a string that is being submitted by our customers from an application on which I cannot put a validation on their end to restrict sending those kind of strings. So, I am trying to write a C# function to split the string into a key value pair / make sure the string matches a format so that the split into key value will be easy.</p>
  
  <p>Here are my examples (ABCD is common in here) and the answer I get should be in the form of below for the examples</p>
  
  <p>ABCD 1234 should be  --> ABCD-1234</p>
  
  <p>ABCD  1234 (two or theree spaces in between) should be ABCD-1234</p>
  
  <p>ABCD 1234 should be(starts with a space)  --> ABCD-1234</p>
  
  <p>ABCD XX1234 should be  --> ABCD-XX1234</p>
  
  <p>ABCD--Z1234 should be --> ABCD-Z1234</p>
  
  <p>ABCDTE ST QA1234 should be --> ABCD-QA1234</p>
  
  <p>A-BCD 1234 ABCD-1234</p>
  
  <p>Also, if possible, I will need this as well integrated into the same function for the above.</p>
  
  <p>ABCDE-GHI491803 Should be WXYZ-491803</p>
  
  <p>ABCDEFGH CT542021 Should be WXYZ-CT542021</p>