Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • $\begingroup$ Quite excessive use of /@ inside Pick. Unleash the full power and beauty of Pick by taking advantage of the Listable attribute: Pick[var, StringTake[ToString /@ var, 1], "e"] and Pick[var, StringContainsQ[ToString /@ var, "e" ~~ _]]. $\endgroup$ Commented Aug 30, 2016 at 6:34
  • $\begingroup$ @Karsten7. my bad habits die hard...and I have been too slow to recognize and apply the operator forms. :) $\endgroup$ Commented Aug 30, 2016 at 6:38
  • $\begingroup$ Note that StringContainsQ["aer", "e" ~~ _] returns True what isn't what you want. The correct test is StringMatchQ["aer", "e" ~~ ___]. $\endgroup$ Commented Aug 30, 2016 at 8:22
  • $\begingroup$ @AlexeyPopkov yes as my comment, perhaps unintelligibly, warns and posits use of WordBoundary. I will edit when I get time. Taking my daughter to her home. If you wish to edit or modify please feel free with your own attribution. $\endgroup$ Commented Aug 30, 2016 at 8:25
  • $\begingroup$ @ubpdqn I've edited the answer and replaced StringContainsQ with correct method which uses StringMatchQ. $\endgroup$ Commented Aug 30, 2016 at 8:33