I am debugging a C# program in Visual Studio. Consider the following snippet.
var List<string> cars = {"honda","bmw","ferrari","ford","jaguar"};
foreach (string car in cars){
purchaseCar(car);
}
I wish to debug the purchaseCar() function when it is called for car="ford". However, while debugging in Visual Studio, I will have to step over(F10) the purchaseCar() function for previous three cars until I can finally step into(F11) it. This would be really tedious if there were a larger number of previous elements.
I wish to know if there is anyway I can directly jump to the ith iteration of a loop while debugging in Visual Studio.
for
there is aforeach
actually. You should use afor
and just change the starting index and voila