delsubstr 237
delsubstr
Syntax
[outstr] = delsubstr(str,charstr)
Parameter List
Inputs: str String or vector of strings.
charstr String
Outputs: outstr String or vector of strings.
Description
All occurences of the substring, charstr, within str are deleted.
If, by deleting charstr, another occurence of charstr in created, it will not be deleted.
Examine the second example closely to see the effect of this.
Unless str is a scalar string, deleting a whole string element will cause an error.
Example
strvec = ["string one";"aaa";"xxyy"]
out1 = delsubstr(strvec,"g o")?
out1 (a column vector of strings) =
strinne
aaa
xxyy
out2 = delsubstr(strvec,"xy")?