Re: My First C# (warning - long post)
- From: "andrewmcdonagh" <andrewmcdonagh@xxxxxxxxx>
- Date: 1 Feb 2007 14:37:00 -0800
On Feb 1, 10:31 pm, "Frank Swarbrick" <Frank.Swarbr...@xxxxxxxxxxxxxx>
wrote:
LX-i<lxi0...@xxxxxxxxxxxx> 02/01/07 7:51 AM >>>
Along those lines - is there a better way to search through an array
other than "for (int i = 0; i < array.length; i++)"?
I'm not sure specifically what you are referring to, but, if we assume the
above code is something like
string array[] = new string[10];
for (int i = 0; i < array.length; i++)
{
doSomething(array[i]);
}
You can replace it with
foreach (string s in array)
{
doSomething(s);
}
Is that what you're looking for?
http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingWithArrays11142...
54AM/WorkingWithArrays.aspx
MF Net Express 5.0 has something similar for COBOL, which I'll post from
home.
Frank
---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
Good call, the other approach is to use Predicates....
see: http://www.c-sharpcorner.com/UploadFile/vandita/
PredicatesInArray10232006063515AM/PredicatesInArray.aspx
Andrew
.
- Follow-Ups:
- Re: My First C# (warning - long post)
- From: LX-i
- Re: My First C# (warning - long post)
- From: Frank Swarbrick
- Re: My First C# (warning - long post)
- References:
- Re: [OT] My First C# (warning - long post)
- From: LX-i
- Re: [OT] My First C# (warning - long post)
- From: Pete Dashwood
- Re: [OT] My First C# (warning - long post)
- From: LX-i
- Re: [OT] My First C# (warning - long post)
- From: Frank Swarbrick
- Re: [OT] My First C# (warning - long post)
- Prev by Date: Re: [OT] My First C# (warning - long post)
- Next by Date: Re: [OT] My First C# (warning - long post)
- Previous by thread: Re: [OT] My First C# (warning - long post)
- Next by thread: Re: My First C# (warning - long post)
- Index(es):
Relevant Pages
|