MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / grep

Method grep

CodenameOne/src/com/codename1/util/regex/RE.java:1608–1627  ·  view source on GitHub ↗
(Object[] search)

Source from the content-addressed store, hash-verified

1606 ///
1607 /// Array of Strings whose toString() value matches this regular expression.
1608 public String[] grep(Object[] search) {
1609 // Create new vector to hold return items
1610 ArrayList v = new ArrayList();
1611
1612 // Traverse array of objects
1613 for (Object item : search) {
1614 // Get next object as a string
1615 String s = item.toString();
1616
1617 // If it matches this regexp, add it to the list
1618 if (match(s)) {
1619 v.add(s);
1620 }
1621 }
1622
1623 // Return vector as an array of strings
1624 String[] ret = new String[v.size()];
1625 v.toArray(ret);
1626 return ret;
1627 }
1628
1629 /// #### Returns
1630 ///

Callers 5

xFunction · 0.80
capture.jsFile · 0.80
invoke2Method · 0.80
xFunction · 0.80
jquery.min.jsFile · 0.80

Calls 5

matchMethod · 0.95
addMethod · 0.95
sizeMethod · 0.95
toArrayMethod · 0.95
toStringMethod · 0.65

Tested by

no test coverage detected