Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

@KEEP -- the inverse of @STRIP

May
572
4
function keep=`%@strip[%@strip[%1,%2],%2]`


E.g., strip everything but digits; i.e., keep only the digits:
> echo %@keep["0123456789",lskjfow68768;lk;l]
68768

Keep only the vowels:
> echo %@keep["aeiou",%@reverse[abcdefghijklmnopqrstuvwxyz]]
uoiea

Dave C.
 
I could, sure. But as it's (A) a reasonable idea, and (B) easy to implement, I think it's quite likely Rex will do it in the next version.
Could, probably easily, overload @STRIP with a third, optional, parameter ([,-]) reversing the sense (strip/keep) of the first parameter.
 
Back
Top