var productNameTags = document.DocumentNode.SelectNodes(textBox3.Text);
var priceTags = document.DocumentNode.SelectNodes(textBox2.Text);
var codeNameAndPrice = productNameTags.Zip(priceTags, (n, w) => new { productNameTags = n, priceTags = w });
int counter = 1;
if (codeNameAndPrice != null)
{
foreach (var nw in codeNameAndPrice)
{
label1.Visible = true;
label1.Text += counter + ". " + nw.productNameTags.InnerHtml + " - " + nw.priceTags.InnerHtml + "\n";
}
}
I have this code which looks at html tags and prints out a product name and a price from a website and prints out like this using .Zip:
- Baseball - £5.00
- Football - £10.00
- Toy Car - £15.00
Is there a simple way of adding three or more variables to zip together using a different method?
e.g.
- Baseball - £5.00 - 1123
- Football - £10.00 - 1124
- Toy Car - £15.00 - 1125
Thanks in advance!