Re: My First C# (warning - long post)



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

.



Relevant Pages

  • Re: Constants, Static, Public, Private
    ... Senior Developer/Analyst - Mainframe Applications ... FirstBank Data Corporation - Lakewood, ...
    (comp.lang.cobol)
  • The True Cost Of Off-the-Shelf
    ... Senior Developer/Analyst - Mainframe Applications ... FirstBank Data Corporation - Lakewood, ...
    (comp.lang.cobol)
  • ambiguous data name
    ... PROCEDURE DIVISION. ... Senior Developer/Analyst - Mainframe Applications ... FirstBank Data Corporation - Lakewood, ...
    (comp.lang.cobol)
  • Re: [OT] My First C# (warning - long post)
    ... Along those lines - is there a better way to search through an array ... I'm not sure specifically what you are referring to, but, if we assume the ... FirstBank Data Corporation - Lakewood, ...
    (comp.lang.cobol)