Test for element in array

Paolo Invernizzi arathorn at NOSPAM_fastwebnet.it
Thu Jul 13 06:25:41 PDT 2006


Hi all,

Someone can suggest me the best way for testing the presence of an 
element in an array?

Coming from python, something like...

if( x in array_of_x && y in array_of_y ){
    ...
}

The workaround, apart from using a simple 'for' loop, is to use an 
associative array, and test for key...

---
Paolo



More information about the Digitalmars-d-learn mailing list