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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Vipul MalhotraRank #276 · 9.1K reputationPosted Feb 26, 2016, 4:21 AM EST
prabhu p172 reputationPosted Feb 26, 2016, 7:13 AM EST
2. In
Please enter second charactr textbox if I enter second character 'e'correctly it should return yes or no
prabhu p172 reputationPosted Feb 26, 2016, 7:15 AM EST
Vipul MalhotraRank #276 · 9.1K reputationPosted Feb 26, 2016, 8:10 AM EST
prabhu p172 reputationPosted Feb 26, 2016, 3:41 PM EST
Ranjit PowarRank #553 · 4.4K reputationPosted Feb 26, 2016, 4:20 PM EST
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.
Krishna Rajput SinghRank #605 · 4K reputationPosted Feb 26, 2016, 6:50 PM EST
Vipul MalhotraRank #276 · 9.1K reputationPosted Feb 26, 2016, 7:09 PM EST