replaceBetween
Replace substrings between start and end points
Syntax
Description
replaces the substring in newStr
= replaceBetween(str
,startPat
,endPat
,newText
)str
with the text in
newText
. replaceBetween
does not replace
startPat
and endPat
themselves. The
newText
argument can have a different number of characters than the
substring it replaces.
replaces the substring in newStr
= replaceBetween(str
,startPos
,endPos
,newText
)str
, including the characters at those
positions.
forces the boundaries specified in the previous syntaxes to be inclusive or exclusive. The
boundaries are inclusive when newStr
= replaceBetween(___,Boundaries=bounds)bounds
is "inclusive"
,
and exclusive when bounds
is "exclusive"
. For example,
replaceBetween(str,startPat,endPat,newText,Boundaries="inclusive")
replaces startPat
, endPat
, and all the text between
them with the text specified by newText
.
Note
Only Stateflow® charts that use MATLAB® as the action language support the replacebetween
operator.
Examples
Limitations
This operator does not support structures. For more information about structures in Stateflow, see Access Bus Signals Through Stateflow Structures.