Startswith is something you do on a string, not on a collection. To properly (and efficiently) get items with a certain criteria from a list, you should do a query on the list. The query can then have a "BeginsWith" or "Contains" filter parameter (see http://msdn.microsoft.com/en-us/library/ms467521.aspx for all parameters you can specify) so you can get a collection of only the items that answer the filter criteria.
[Description: Description: Description: C:\Users\Brian\Pictures\EXD Logos\Extelligent logo no text.jpg]Ishai Sagi | Solutions Architect 0488 789 786 | is...@exd.com.au<mailto:is...@exd.com.au> | www.sharepoint-tips.com<http://www.sharepoint-tips.com/> | @ishaisagi<http://twitter.com/ishaisagi> From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of Paul Noone Sent: Wednesday, 26 October 2011 10:57 AM To: ozMOSS (ozmoss@ozmoss.com) Subject: Filter item collection Hi all, I want to filter an SPListItemCollection based on a provided string in the item Name. Can I do this using string StartsWith, or should I run an SPQuery against the collection? Kind regards, Paul Noone --------------------------------------------------- Online Developer/SharePoint Administrator Infrastructure Team, ICT Catholic Education Office, Sydney p: (02) 9568 8461 f: (02) 9568 8483 e: paul.no...@ceosyd.catholic.edu.au<mailto:paul.no...@ceosyd.catholic.edu.au> w: http://www.ceosyd.catholic.edu.au/
<<inline: image001.jpg>>
<<inline: image002.jpg>>
_______________________________________________ ozmoss mailing list ozmoss@ozmoss.com http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss