Tutorials
Resources
Forum
Reviews
Communities
Interview
Jobs
Projects
Training
Your
Ad
Here
Silverlight Games
|
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Polls
|
Revenue Sharing
|
Lobby
|
Gift Shop
|
Prizes & Awards
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
srinivas kante...
(63)
Alwyn
(56)
Abhisek Panda
(42)
Last 7 Days
Alwyn
(720)
nishithraj
(512)
Gaurav Arora
(503)
more...
Resources
»
Code Snippets
»
C# Syntax
»
String comparison
Posted Date: 05 Nov 2008
Resource Type:
Code Snippets
Category:
C# Syntax
Author:
Abhijeet Kumar
Member Level:
Gold
Rating:
Points
: 5
Strings has always been my favourite topic and given the shance i can keep talking about them for hours.
In this string comparison has been my favourite, because every develope at one time or another needs to perform String comparison and most of the times does it the wrong way.
During my code reviews this the item which have seen maximum times,
if(textbox1.Text.Trim().ToLower() == "ABC")
{
//Do Something
}
I can bet maximum number of people make this mistake without realizing that they have just created an extra string object and added to the workload of GC.
The better approach for doing this is use inbuild compare method.
string.Compare(string1,string2,false);
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
to add tags.
String Comparison
.
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
C#:Cross Language Assembly Implementation
Previous Resource:
Protected Members
Return to Discussion Resource Index
Post New Resource
Category:
C# Syntax
Post resources and
earn money
!
More Resources
C#:Cross Language Assembly Implementation
C#Using Private Assembly
C#:Creating Private Assembly
Creation and Deployment of Webservice in C#
Giving File IO permissions dynamically
How to empty all TextBoxes of the page at one shot?
dotNet Slackers
About Us
Contact Us
Privacy Policy
Terms Of Use