Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Collection Filter

DZone's Guide to

Collection Filter

·
Free Resource
// description of your code here


List
  
    stringList=new ArrayList();
stringList.add("11");
stringList.add("21");
stringList.add("31");
stringList.add("101");
stringList.add("111");

Collection filteredCollection=CollectionUtils.select(stringList,new Predicate(){
			public boolean evaluate(final Object dto) {
				return (dto.startsWith("1"));
			}			
		});

  
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}