PC Review


Reply
Thread Tools Rate Thread

Arraylist Contains() Question

 
 
ajay.kalyan@gmail.com
Guest
Posts: n/a
 
      23rd Aug 2006
I am trying to add an object to an arraylist, but first I need to see
if the an object with a specified instance value already exists in the
arraylist. The Contains(obj) function checks the entire object but I
only need to check 1 instance variable in the object and return true or
false based on that.

My java experience tells me that it might have something to do with the
CompareTo() method, but I dont even know if the CompareTo method is
being used in the Contains() method. How would I go about creating a
Contains(string). Can I not override some method to get the desired
result or do I have to manually iterate the arraylist and check each
object?

Any help would be appreciated.

thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
arrayList question NuCoder Microsoft C# .NET 4 16th Jun 2005 05:55 PM
Arraylist Question Roshawn Dawson Microsoft VB .NET 1 21st Feb 2005 06:09 AM
ArrayList question =?Utf-8?B?U2NvdHQ=?= Microsoft Dot NET Framework 2 31st Jan 2005 06:29 PM
Arraylist simple question (newbie) OT (for a CF project, but not necessarily a CF question?) Keith R Microsoft Dot NET Compact Framework 1 2nd Dec 2003 10:27 PM
ArrayList Question george r smith Microsoft C# .NET 3 14th Nov 2003 11:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:41 PM.