partitionString


Description:

public static Pair<ArrayList<string>,ArrayList<string>> partitionString (ArrayList<string> list, owned PredicateFunc<string> fn)

Splits a string list into two lists based on a predicate. The first list contains elements matching the predicate, the second contains the rest.

Example:

    var pair = Lists.partitionString (list, (s) => {
return s.has_prefix ("a");
});
// pair.first = items starting with "a"
// pair.second = all others

Parameters:

list

the source list.

fn

the predicate.

Returns:

a Pair of (matching, non-matching) lists.