this is kinda hard to explain, but I will try my best.
So I want to have 3 TextBoxes.
TextBox 1(Input): "X:Y:Z"
TextBox 2(Input): "A:B"
TextBox 3(Output):
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.
If it equals it should give out in TextBox3: X:B:Z If not it shouldn't give it out in TextBox3.
EXAMPLES:
TB1: abc:123:def
TB2: 123:bla
TB3: abc:bla:def
------
TB1: abc:741:def
TB2: 345:bla
TB3: no output
This is what I got:
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 < textToReplace.Length; i++)
{
if (i > 0)
{
textBox3.AppendText(":");
}
textBox3.AppendText(textToReplace[i].Replace(replacementArray[0],
replacementArray[1]));
}
}
}
IMG for 1 Line working:

For the first line it works great but not for the following. Thanks for all the HELP!