How to compare two string in c#
for ex input str = "Welcome123"
then please enter second character in textbox if Enter 'e' as second character it should check with previous Str and return yes or not
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vipul MalhotraPosted Feb 27, 2016, 12:09 AM
Krishna Rajput SinghPosted Feb 26, 2016, 11:50 PM
Ranjit PowarPosted Feb 26, 2016, 9:20 PM
string str1 = TextBox1.Text.Substring (0,1);
string str2=TextBox2.Text.Substring(0,1);
if(str1==str2)
{
return true;
}
else
{
return false;
}
If it help you select it as correct answer.
prabhu pPosted Feb 26, 2016, 8:41 PM
Vipul MalhotraPosted Feb 26, 2016, 1:10 PM
prabhu pPosted Feb 26, 2016, 12:15 PM
prabhu pPosted Feb 26, 2016, 12:13 PM
2. In
Please enter second charactr textbox if I enter second character 'e'correctly it should return yes or no
Vipul MalhotraPosted Feb 26, 2016, 9:21 AM