eraseBetween
Delete substrings between start and end points
Syntax
Description
deletes all characters from newStr
= eraseBetween(str
,startPat
,endPat
)str
that occur between the substrings
startPat
and endPat
, but does not delete
startPat
and endPat
themselves.
eraseBetween
returns the remaining text as
newStr
.
If str
is a string array or a cell array of character vectors,
then eraseBetween
deletes characters from each element of
str
. The output argument newStr
has the
same data type as str
.
forces the starts and ends specified in any of the previous syntaxes to be either
inclusive or exclusive. They are inclusive when newStr
= eraseBetween(___,'Boundaries',bounds
)bounds
is
'inclusive'
, and exclusive when bounds
is
'exclusive'
. For example,
eraseBetween(str,startPat,endPat,'Boundaries','inclusive')
deletes startPat
, endPat
, and all the text
between them.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2016b