String Equal function.

code

//string_match.cs
// Comparing strings.
using System;
namespace StringCompare
{
class StringCompare
{
string process;
public void comparestring( string s1, string s2)
{
// test for equality using Equals method
if ( s1.Equals( s2) )
{ process += "Password 1 equals " + s1;}
else
{ process += "Password 2 does not equal " + s1;}
Console.WriteLine(process);
}
}
class test
{
[STAThread]
static void Main(string[] args)
{
StringCompare st = new StringCompare();
Console.Write("Enter Password : ") ;
string p1 = Console.ReadLine();
Console.Write("Repeat Password :") ;
string p2 = Console.ReadLine();
st.comparestring(p1,p2);
}

}

}