replaceBetween
语法
描述
将 newStr
= replaceBetween(str
,startStr
,endStr
,new
)str
中位于子字符串 startStr
和 endStr
之间的子字符串替换为字符串 new
。 replaceBetween
不会替换 startStr
和 endStr
本身。 new
的字符数可以与其替换的子字符串不同。在 Requirements Table模块中使用此运算符。
替换 newStr
= replaceBetween(str
,startPos
,endPos
,new
)str
中位于 startPos
和 endPos
字符位置之间的子字符串,包括这些位置上的字符。
在运算符替换的子字符串中包含或排除前面语法中指定的边界。将 newStr
= replaceBetween(___,Boundaries=bounds
)bounds
指定为 "inclusive"
或 "exclusive"
。
示例
输入参数
输出参量
限制
该运算符不支持使用
Simulink.Bus
对象字段。
版本历史记录
在 R2022b 中推出