Say I created a method void test (byte var) and the var only take a number in the Range(1, 3) only.
How can I define the "var" to make this possible??
Say I created a method void test (byte var) and the var only take a number in the Range(1, 3) only.
How can I define the "var" to make this possible??
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
Scott LysleRank #49 · 31K reputationPosted Jun 6, 2008, 6:57 AM EDT
private string Test(byte b)
{
if (b >= 1 && b <= 3)
{
return "Good enough";
}
else
{
return "Out of range";
}
}