Click here to Skip to main content
15,914,452 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,
I have a small issue,how to compare two values
here one single value compare in list of values,
for example if string s="csharp",this value compare list of values
Posted
Comments
Maciej Los 5-Oct-15 7:30am    
What you mean by "compare"? Do you want to get exact match or similar?
Naveen.Sanagasetti 5-Oct-15 7:31am    
If you want to compare list of values then iterate it through out all the values and then compare.

 
Share this answer
 
v2
Hi,
You can use String.Compare() for compare two strings
For ex:
C#
string MyString = "csharp";
Console.WriteLine(String.Compare(MyString, "csharpexample"));
 
Share this answer
 
Comments
Shivaram_i 8-Oct-15 8:00am    
Dear person,Who Downvoted this answer.Will you please explain what is the mistake here?????
Hope that great person giving reply here.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900