String comparisons using C#.NET string.compareTo
by
Thamilselvanj
on
Nov 14, 2010
Category:
String Operations
|
Views:
289
|
Points:
25
|
Silver ★
|
|
|
class Program { static void Main(string[] args) { string strFirstString = "Sample"; string strSecString = "Simple"; if (strFirstString.CompareTo(strSecString)==0) { Console.WriteLine("Both strings are same"); } else { Console.WriteLine("Both strings are not same"); } Console.ReadKey();
} }
|
Like this code? Bookmark and Share:
|
|
|
|
No Response found!
|
|
|
|
|