replaceBetween
Syntax
Description
replaces the substring in newStr
= replaceBetween(str
,startStr
,endStr
,new
)str
between the substrings
startStr
and endStr
with the string
new
. replaceBetween
does not replace
startStr
and endStr
themselves.
new
can have a different number of characters than the substring it
replaces.
replaces the substring in newStr
= replaceBetween(str
,startPos
,endPos
,new
)str
between the character positions
startPos
and endPos
, including the characters at
those positions.
includes or excludes the boundaries specified in the previous syntaxes from the substring
that the operator replaces. Specify newStr
= replaceBetween(___,Boundaries=bounds
)bounds
as
"inclusive"
or "exclusive"
.
Note
The replaceBetween
operator is not supported in Stateflow® charts that use C as the action language.
Examples
Input Arguments
Limitations
This operator does not support the use of Stateflow structure fields or messages. For more information about structures in Stateflow, see Access Bus Signals.
Version History
Introduced in R2021b