Thursday 30 August 2018

ComparisonOfString


Add this code in your button click
       
        string string1 = Convert.ToString(txtString1.Text);//assign the value in the textbox to a string variable.
        string string2 = Convert.ToString(txtString2.Text);
        if(string1 == string2)//compare the string you enter
        {
            Response.Write("<script> alert ('String 1 and 2 are Same')</script>");
        }
        else
        {
            Response.Write("<script> alert ('String 1 and 2 are not Same')</script>");
        }
        txtString1.Text = "";
        txtString2.Text = "";

No comments:

Post a Comment