【发布时间】:2022-10-15 02:08:43
【问题描述】:
试图在 MUMPS 中编写代码以在字符串中用新的替换旧的。 然而新包含旧。
预期答案="我的老朋友" 但是得到了=“我的老朋友” 我如何得到预期的答案?
s str="My old old friend"
s old="old"
s new="very old"
n ctr,max
s max=$L(str)
f ctr=1:1:($L(str,$E(old))-1) i $F(str,old)>0 s $E(str,$F(str,old)-$L(old),$F(str,old)-1)=new s count=count+1
q str
【问题讨论】:
标签: mumps