title: Parsing EDI messages from strings in C#
body: <p>I've got this string:</p>
  
  <blockquote>
    <p>UNB+UNOA:1+094200005560743089001003:OD+094200005565200077SP0001:OD+100705:1017+570180'UNH+1+SYNCRO:2::OD'MID+102711015461800+100705:1014'CDT+::::::BQ6UB'BDT+::::::1003-002'CSG+:Nisses
    MONTERING:::::BP2TH+005+TCSB'SEQ+CR+2059433+YV1CM5957B1574778:602816985'ARD+39855213::PART
    NO'SDD+100705+1'UNT+9+1'UNZ+1+570180'</p>
  </blockquote>
  
  <p>This string should be divided into smaller pieces that should be stored away in different variables. The text can be divided into </p>
  
  <ol>
  <li>multiple lines by using a separator text (which is a <code>'</code> character) and </li>
  <li>multiple values in each row with two types of separator text (<code>+</code> sign and also <code>:</code> character).</li>
  </ol>
  
  <p>The text that appears above is an order, in the form of materials, of a company (customer) to another company (supplier). When the supplier received the order in the form of a text file that is loaded into a computer program, this program splits the text up into small parts and store them in different variables which will be stored in a database at a later stage.</p>
  
  <p>The purpose is to create a form using C#. This form should has a text field when the user will input the text line and then a button, once the user pushes the button the text entered into the text field will be divided into small parts and each part will be stored in a different variable. Once the text is split and stored in variables, all the data should be stored in an array or in an object (a class).</p>
  
  <hr>
  
  <p>All values are stored as strings.
  The line consists of:</p>
  
  <pre>
  Textpart1 Textpart2 + + + + ... Textpart2 text portion (s) '
  </pre>
  
  <p>Each text portion consists of the following:</p>
  
  <pre>
  Part 1: Part2: Part 3: Part4: Part5 ... Part (n)
  </pre>
  
  <p>Each value can therefore be stated on the form</p>
  
  <pre>
  Text-> Text line-> text portion-> Del
  </pre>
  
  <p>Each text begins with a value that identifies what the information saved on the line. The first value in each row thus called for the key value (ex. MID, SEQ, ARD, etc.). Right now there are only one key value every once in each text.</p>
  
  <p>Here Synroid textpart2 listed as Part 1 and the row that has the MID as the key value. SynroTid indicated that textdel3 and del2.</p>