i have this code which should insert all elements of array which is some html on random places in a string. but it only inserts last element to that string. please help
Random insertPos = new Random();
int pos = insertPos.Next(txtInput.Text.Length);
int firSpace= txtInput.Text.IndexOf(" ", pos);
int secSpace = txtInput.Text.IndexOf(" ", firSpace+1);
int wLen = secSpace - firSpace;<br/>
string word = txtInput.Text.Substring(firSpace,wLen);
foreach (string url in urlArray)
{
txtOutput.Text =
txtInput.Text.Replace(word, "<a href=\"" + url + "\">" + word + "</a>");
}