Code1:
Boolean DoSomething(string\[\] values)
{
foreach (string s in values)
if (s == "ABC")
return true;
return false;
}
Code2:
Boolean DoSomething(string[] values)
{
bool retValue = false;
foreach (string s in values)
if (s == "ABC")
retValue=true;
return retValue;
}
in the above 2 codes which code you will suggest and why? waiting for your valuable comments. Thanks --RA