Here's my code that a co worker suggested I change to use the string.Equals() 
method to compare instead.

 

if(dropDownListCheckInStatus.Items[x].Value.ToString() == 
dataRow["CheckInStatusID"].ToString())

{

//

}

 

I searched and found that all these methods work for comparison but what is the 
best or more efficient?

 

// String comparison
string mascot = "Bisons"; 
if (mascot == "Bisons")    // true
if (mascot.Equals("Bisons"))   // true
if (mascot.ToUpper().Equals("BISONS"))   // true
if (mascot.CompareTo("Bisons") == 0)    // true

 

Thanks,

Jim



                
---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




Reply via email to