How to compare two strings with out Case sensitive ?

Answers were Sorted based on User's Feedback



How to compare two strings with out Case sensitive ?..

Answer / minhajul islam

string str1="Hello1";
string str2="Hello2";

String.Compare(str1,str2,true)

//true if you want compare two string without case
sensative and false if you want to case sensative.

//It will return Zero if compare as equal and 1 if not.

Is This Answer Correct ?    16 Yes 2 No

How to compare two strings with out Case sensitive ?..

Answer / navin.cp

Here is the code that solve ur problem:

string str = "virtual";
if (str.Equals("virtual"))
{
// your code here....
}

Is This Answer Correct ?    8 Yes 6 No

How to compare two strings with out Case sensitive ?..

Answer / manu

with
String.Compare(string a,string b) [result 0 only when it
is equal- since it compares by subtracting ascii of b from
ascci of a)
or
String.Equals(string a,string b) {true if it is equal]
we can achieve the same

Is This Answer Correct ?    5 Yes 6 No

How to compare two strings with out Case sensitive ?..

Answer / sekar thangavel

sting.Equals(string a,string b)

Explanation:
Determines whether two specified system.string objects have
the same values,a parameter specifies the culture,case and
sort rules used in the comparison

Is This Answer Correct ?    4 Yes 7 No

Post New Answer

More ASP.NET Interview Questions

What is caching in asp.net?

0 Answers  


How does SQL Server session state works

1 Answers   Emphasis,


What are different ASP.NET Web Forms with the technology different from though ASP (1.0-3.0)?

1 Answers   Siebel,


What are the navigation ways between pages available in ASP.NET?

0 Answers   Winsol Solutions,


how many session modes are available?some brief explnation

1 Answers  






How would you create a permanent cookie?

0 Answers  


Can more than one person use the same login?

0 Answers   MCN Solutions,


What are all the ways to find out types of objects?

5 Answers   HCL,


What is latest version of asp.net mvc? : Asp.Net MVC

0 Answers  


What is web.config file ?

1 Answers  


Why we use asp.net for website development?

0 Answers  


How Can we use multiple forms in single asp.net application?

3 Answers   Polaris,


Categories