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

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -