eraseBetween
Delete substrings between indicators that mark starts and ends of substrings
Syntax
newStr = eraseBetween(str,startStr,endStr)
newStr = eraseBetween(str,startPos,endPos)
newStr = eraseBetween(___,'Boundaries',bounds)
Description
deletes all characters fromnewStr
= eraseBetween(圣r
,圣artStr
,endStr
)圣r
that occur between the substrings圣artStr
andendStr
,但not delete圣artStr
andendStr
themselves.eraseBetween
returns the remaining text asnewStr
.
If圣r
is a string array or a cell array of character vectors, theneraseBetween
deletes characters from each element of圣r
. The output argumentnewStr
has the same data type as圣r
.
forces the starts and ends specified in any of the previous syntaxes to be either inclusive or exclusive. They are inclusive whennewStr
= eraseBetween(___,'Boundaries',bounds)bounds
is'inclusive'
, and exclusive whenbounds
is'exclusive'
. For example,eraseBetween(str,startStr,endStr,'Boundaries','inclusive')
deletes圣artStr
,endStr
, and all the text between them.
Examples
Input Arguments
Output Arguments
Extended Capabilities
See Also
count
|erase
|extractAfter
|extractBefore
|extractBetween
|insertAfter
|insertBefore
|join
|replace
|replaceBetween
|size
|split
|圣rlength