I'm having two string.
- string
- StriNG
Compare these two string and the result should be TRUE (ie,) both the string are same.
Thanks In Advance..
I'm having two string.
Compare these two string and the result should be TRUE (ie,) both the string are same.
Thanks In Advance..
In .NET strings are case-sensitive, so "string"
is different from "String"
, or whatever. If you want to ignore lowercase and uppercase differences use:
string.Compare(strA, strB, true);
This will return an int (-1, 0, 1). If you want a boolean instead just use:
string.Equals(strA, strB, StringComparison.OrdinalIgnoreCase); // or InvariantCultureIgnoreCase, CurrentCultureIgnoreCase
Anyway it results a bit difficult to understand what you are asking in this question. I hope I have guessed what you wanted to know.