Home > freetb4matlab > strings > index.m

index

PURPOSE ^

% Return the position of the first occurrence of the string @var{t} in the

SYNOPSIS ^

function n = index (s, t, direction)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {} index (@var{s}, @var{t})
% @deftypefnx {Function File} {} index (@var{s}, @var{t}, @var{direction})
% Return the position of the first occurrence of the string @var{t} in the
% string @var{s}, or 0 if no occurrence is found.  For example,
%
% @example
% @group
% index ('Teststring', 't')
%      @result{} 4
% @end group
% @end example
%
% If @var{direction} is @samp{'first'}, return the first element found.
% If @var{direction} is @samp{'last'}, return the last element found.
% The @code{rindex} function is equivalent to @code{index} with
% @var{direction} set to @samp{'last'}.
%
% @strong{Caution:}  This function does not work for arrays of
% character strings.
% @seealso{find, rindex}
% @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