extractBefore
Extract substrings before specified positions
Description
extracts the substring that begins with the first character of
newStr
= extractBefore(str
,pat
)str
and ends before the substring specified by
pat
. If pat
occurs multiple times in
str
, then newStr
is str
from the start of str
up to the first occurrence of
pat
.
If str
is a string array or a cell array of character vectors,
then extractBefore
extracts substrings from each element of
str
. The output argument newStr
has the
same data type as str
.
Examples
Input Arguments
Output Arguments
Extended Capabilities
Version History
Introduced in R2016b