c# - Does Index of Array Exist -
I inherited some code at work which is really bad smell I'm hoping to find the most painless solution I am
Is there a way to check that some arbitrary number is a valid element in an array?
Example - I have to check if array [25] is present.
I prefer to do so without having to do the forearm () through the array to find the rows.
Is there any way to do this, or I got stuck with the foreach loop?
check the length
int index = 25; If (index lang) {// it exists}
Comments
Post a Comment