How to check if string has at least 2 characters?
THANKS
Checking if string exist at least 2 characters
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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
VulpesRank #55 · 29.2K reputationPosted Dec 2, 2013, 7:07 AM EST
1. if (str.Length >= 2) { // do something }
2. if (str.Contains(char1.ToString()) && str.Contains(char2.ToString())) { // do something }
Mahesh AlleRank #521 · 4.7K reputationPosted Dec 2, 2013, 4:43 AM EST