Another of those tedious chores that pollute applications - you
could write your own code, but it's probably easier to use the various
functions in the supplied <dfns> workspace...
- ss - Simple substitution in vectors (matrix sources are accepted but the result is always a vector)
- ssmat - Similar to <ss>, but handles matrix sources properly
- Same syntax as <ss> and <ssmat>, but replacement only
operates on whole words (see the Dyalog documentation to see what the
definition of a word is)
- subs - Dyalog say that this is more flexible and may be faster
ss ⎕a 'ABC' 'DEF'
ss (2 26⍴⎕a) 'ABC' 'DEF'
ssmat (2 26⍴⎕a) 'ABC' 'DEF'
ssword 'a banana is an type of fruit' 'an' 'a'
a banana is a type of fruit
'ABC' 'DEF' subs ⎕a
- There is also an <ss> in the <xutils> workspace, which can use regular expressions for matches.
Page created 20 April