I'm completely new to c# sorry if asked here anything meaningless for you guys but I would like to know how can I solve this type of situation.
I having two arraylist's as shown below:
ArrayList OldLinks = new ArrayList();
ArrayList NewLinks = new ArrayList();
ArrayList mylist = new ArrayList();
foreach (string oldlink in OldLinkArray)
{
OldLinks.Add(oldlink);
}
foreach (string newlink in NewLinkArray)
{
NewLinks.Add(newlink);
}
Now I need to get them as single arraylist with two items each
I need to get it as
ArrayList NewList = new ArrayList();
NewList.Add(oldlink, newLink);
ArrayListunless you're forced at gunpoint by your boss. it's an ancient relic from a barbaric time when we didn't have generics. take a look at the more sensibleSystem.Collections.Genericnamespace (hint:List<T>)!Dictionary?DictionaryorHashSet(if you do not have duplicate key-value at all), orKeyValuePair.ArrayListis rather outdated (though in some cases it might still be used),Listis the way to go for collection of single type.DictionaryorHashSetfor key-value collections. Check this for speed difference,HashSetis faster