sstatus SciMax Toolbox ssubstfirst

SciMax Toolbox >> ssubst

ssubst

Maxima Function

Calling Sequence

ssubst (new, old, string)
ssubst(new,old,string,test)
ssubst(new,old,string,test,start)
ssubst(new,old,string,test,start,end)

Description

Returns a string like string except that all substrings matching old are replaced by new. old and new need not to be of the same length. Default test function for matching is sequal. If ssubst should ignore case while searching for old, use sequalignore as test. Use start and end to limit searching. Note that the first character in string is in position 1.

(%i1) ssubst("like","hate","I hate Thai food. I hate green tea.");
(%o1)          I like Thai food. I like green tea.
(%i2) ssubst("Indian","thai",%,'sequalignore,8,12);
(%o2)         I like Indian food. I like green tea.
sstatus SciMax Toolbox ssubstfirst