The remove command removes elements of a list according to a given conditions.
Example.
Input:
Output:
⎡ ⎣ | 0,1,1 | ⎤ ⎦ |
Remark: You can use remove to remove characters from
a string. For example, to remove all the "a"s of a string
(see Section 12.1.2 for writing functions):
Input:
then:
f(chn):={ |
local l:=length(chn)-1; |
return remove(x->(ord(x)==orda),seq(chn[k],k,0,l)); |
}
|
Now:
Input:
Output:
⎡ ⎣ | "b","r","c","d","b","r" | ⎤ ⎦ |
To get a string:
Input:
Output:
"brcdbr" |