How does one compare strings in c#?



How does one compare strings in c#?..

Answer / Ravi Prakash Gupta

In C#, you can compare strings using the '==' operator for value comparison or the String.Equals() method for case-sensitive and culture-invariant comparisons. For case-insensitive comparisons, you can use the String.Equals(String, StringComparison) method.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Explain about generics in c#.net?

1 Answers  


What?s the C# equivalent of C++ catch (?), which was a catch-all statement for any possible exception?

1 Answers  


What is the difference between gettype and typeof in c#?

1 Answers  


How do I use the 'using' keyword with multiple objects?

1 Answers  


Is and as keyword in c# net?

1 Answers  


if we are updating a database using thread, and mean while application crashes or thread being aborted then what will happen in Database? Rollback or Database will be updated? Please explain with different scenario.

1 Answers  


Why constructor is used in c#?

1 Answers  


What is the purpose of a console table?

1 Answers  


why sturcture ? why class?why you prefer structure and in which cases u go for class?

1 Answers   Microsoft,


Explain code compilation in c#.

1 Answers  


The int maps to which C# keyword in .NET type?

1 Answers   Siebel,


Is hashset serializable c#?

1 Answers  


Categories