Home > freetb4matlab > strings > strfind.m

strfind

PURPOSE ^

% Search for @var{pattern} in the string @var{str} and return the

SYNOPSIS ^

function idx = strfind (text, pattern)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {@var{idx} =} strfind (@var{str}, @var{pattern})
% @deftypefnx {Function File} {@var{idx} =} strfind (@var{cellstr}, @var{pattern})
% Search for @var{pattern} in the string @var{str} and return the
% starting index of every such occurrence in the vector @var{idx}.
% If there is no such occurrence, or if @var{pattern} is longer
% than @var{str}, then @var{idx} is the empty array @code{[]}.
%
% If the cell array of strings @var{cellstr} is specified instead of the
% string @var{str}, then @var{idx} is a cell array of vectors, as specified
% above.  Examples:
%
% @example
% @group
% strfind ('abababa', 'aba')
%      @result{} [1, 3, 5]
%
% strfind (@{'abababa', 'bebebe', 'ab'@}, 'aba')
%      @result{} ans =
%         @{
%           [1,1] =
%
%              1   3   5
%
%           [1,2] = [](1x0)
%           [1,3] = [](1x0)
%         @}
% @end group
% @end example
% @seealso{findstr, strmatch, strcmp, strncmp, strcmpi, strncmpi, find}
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003