Here you go..
I used 2 textBoxes just replace it with richttextbox.text and your set :) tested and works ;)



private List<string> Chains = new List<string>();
private...