strings: string manipulation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
character substitution characterpairs charsub string For example: '-_$ ' charsub '$123 -456 -789' 123 _456 _789 Use <rplc> for arbitrary string replacement. thanks to Dan Bron/Jforum 25 April 2006 cut y at x (conjunction) string (verb cuts n) text n=_1 up to but not including string n= 1 up to and including string n=_2 after but not including string n= 2 after and including string delete multiple leading and trailing blanks text is delimited by characters in x with default LF example: < 'A' dltbs ' A abc def Ars A x y z ' +-------------------+ |Aabc defArsAx y z| +-------------------+ delete multiple trailing blanks in text text is delimited by characters in x with default CRLF example: < 'A' dtbs ' A abc def Ars A x y z ' +----------------------+ |A abc defArsA x y z| +----------------------+ Algorithm thanks to Brian Bambrough (JForum Nov 2000) file string replace form: (old;new) fstringreplace file replace characters in text string form: text rplc oldnew oldnew is a 2-column boxed matrix of old ,. new or a vector of same replace priority is the same order as oldnew Examples: 'ababa' rplc 'aba';'XYZT';'ba';'+' XYZT+ 'ababa' rplc 'ba';'+';'aba';'XYZT' a++ replace characters in text string form: oldnew stringreplace text oldnew is a 2-column boxed matrix of old ,. new or a vector of same stringreplace priority is the same order as oldnew Examples: ('aba';'XYZT';'ba';'+') stringreplace 'ababa' XYZT+ ('ba';'+';'aba';'XYZT') stringreplace 'ababa' a++
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
>> << Ndx Usr Pri JfC LJ Phr Dic Rel Voc !: wd Help User |