The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

C# and ArrayLists by tzulah 2004-10-21 13:55:04
The Microsoft documentation has outsmarted me once again. I have an ArrayList that is populated with a bunch of strings, and before adding a new string I want to check if it already exists. I'm using the following:

if (myArrayList.Contains(newString) == true)
{
...
}

The problem is that it is a case sensitive comparison. I need a case insensitive comparison. Is there an easy way to do this, or do I have to go to all of the trouble of looping through every list item myself and doing a case insensitive string.Compare on every string? Gahhhh!
[ Reply ]
  Couldn't you make all strings lower-case before by Scirocco2004-10-21 14:00:56
    I need to retain case (n/t) by tzulah2004-10-21 14:03:23
  And now, the real problem by tzulah2004-10-21 14:02:50
  You need to loop and compare. by ManiacJoe2004-10-21 14:03:18
  The docs say listbox compares by ManiacJoe2004-10-21 14:11:15
    We have a winner! by tzulah2004-10-21 14:55:23
  You can usually by Didactylos2004-10-21 14:18:16

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)