title: C# String/Array Replacement
body: <p>this is kinda hard to explain, but I will try my best.</p>
  
  <p>So I want to have 3 TextBoxes.</p>
  
  <p>TextBox 1(Input): "X:Y:Z"</p>
  
  <p>TextBox 2(Input): "A:B"</p>
  
  <p>TextBox 3(Output):</p>
  
  <p>Now for each Line I want to Compare Y and A. Each Lines in TextBox1 Looks like this:
  "ABC:123:DEF"
  now it should split out 123 and compare it with A, which is splitted from B aswell.</p>
  
  <p>If it equals it should give out in TextBox3: X:B:Z
  If not it shouldn't give it out in TextBox3.</p>
  
  <p>EXAMPLES:</p>
  
  <pre><code>TB1: abc:123:def 
  TB2: 123:bla 
  TB3: abc:bla:def
  ------      
  TB1: abc:741:def 
  TB2: 345:bla 
  TB3: no output
  </code></pre>
  
  <p>This is what I got: </p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      var textToReplace = textBox1.Text.Split(':');
      var replacementArray = textBox2.Text.Split(':');
  
      if (replacementArray.Length == 2)
      {
          textBox3.Clear();
  
          for (var i = 0; i &lt; textToReplace.Length; i++)
          {
              if (i &gt; 0)
              {
                  textBox3.AppendText(":");
              }
  
              textBox3.AppendText(textToReplace[i].Replace(replacementArray[0], 
              replacementArray[1]));
          }
      }
  }
  </code></pre>
  
  <p>IMG for 1 Line working: </p>
  
  <p><img src="https://i.imgur.com/ZuDvbDT.png" alt=""></p>
  
  <p>For the first line it works great but not for the following. 
  Thanks for all the HELP!</p>