| DEFUN_DLD (strfind, args,,"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {@var{idx} =} strfind (@var{str}, @var{pattern})\n\
@deftypefnx {Loadable Function} {@var{idx} =} strfind (@var{cellstr}, @var{pattern})\n\
Search for @var{pattern} in the string @var{str} and return the\n\
starting index of every such occurrence in the vector @var{idx}.\n\
If there is no such occurrence, or if @var{pattern} is longer\n\
than @var{str}, then @var{idx} is the empty array @code{[]}.\n\
\n\
If a cell array of strings @var{cellstr} is specified\n\
then @var{idx} is a cell array of vectors, as specified\n\
above. Examples:\n\
\n\
@example\n\
@group\n\
strfind (\"abababa\", \"aba\")\n\
@result{} [1, 3, 5]\n\
\n\
strfind (@{\"abababa\", \"bebebe\", \"ab\"@}, \"aba\")\n\
@result{} ans =\n\
@{\n\
[1,1] =\n\
\n\
1 3 5\n\
\n\
[1,2] = [](1x0)\n\
[1,3] = [](1x0)\n\
@}\n\
@end group\n\
@end example\n\
@seealso{findstr, strmatch, regexp, regexpi, find}\n\
@end deftypefn") |
| DEFUN_DLD (strrep, args,,"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {} strrep (@var{s}, @var{ptn}, @var{rep})\n\
@deftypefnx {Loadable Function} {} strrep (@var{s}, @var{ptn}, @var{rep}, \"overlaps\", @var{o})\n\
Replace all occurrences of the substring @var{ptn} in the string @var{s}\n\
with the string @var{rep} and return the result. For example:\n\
\n\
@example\n\
@group\n\
strrep (\"This is a test string\", \"is\", \"&%$\")\n\
@result{} \"Th&%$ &%$ a test string\"\n\
@end group\n\
@end example\n\
\n\
@var{s} may also be a cell array of strings, in which case the replacement is\n\
done for each element and a cell array is returned.\n\
@seealso{regexprep, strfind, findstr}\n\
@end deftypefn") |