I want to collect words that do not contain a certain character.
I feel it should be much easier than my current solution (which makes heavy-handed use of regular expressions).
But alas, I'm just not getting it.
Here's my current solution, that works:
want(s) = match(r"\?",s) == nothing
[s for s in lst if want(s)]
Everything else gives me syntax errors:
[s for s in lst if not '?' in s]
[s for s in lst if not ('?' in s)]
filter((x) -> not ('?' in x),["?asdas","bbb"])
I can do it with a verbose ternary operator:
filter((x) -> ('?' in x ? false : true),["?asdas","bbb"])
but that does not seem elegant.
Suggestions?