|
-
October 11th, 2012 06:28 PM
#1
if condition in foreach loop
Hi all,
I have something like this in my code..
I have a Students list.
foreach(var name in Students)
{
if(name.StudentName == "John")
{
//Do Something
}
else(name.StudentName == "ALEX")
{
//Do Something
}
}
Is there any better approach for this?
Thanks,
Genith
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Click Here to Expand Forum to Full Width
|
Bookmarks