remove_all
| Definition: | sequence res = remove_all(object needle, sequence haystack) |
| Description: |
Removes all occurrences of some object from a sequence.
needle: the object to remove. haystack: the sequence to remove from. Returns a sequence, of length at most length(haystack), and which has the same elements, but without any copy of needle left. |
| pwa/p2js: | Supported, though naturally I’m much more of a filter() fan. |
| Comments: |
This function weeds out elements, not sub-sequences.
This routine is defined in builtins\premoveall.e (an autoinclude), and is provided only for compatibility with Euphoria. |
| Example: |
s = remove_all( 1, {1,2,4,1,3,2,4,1,2,3} ) -- s is {2,4,3,2,4,2,3}
s = remove_all('x', "I'm toox secxksy for my shixrt.") -- s is "I'm too secksy for my shirt."
|