Mercurial > hg > octave-lyh
diff scripts/strings/findstr.m @ 8442:502e58a0d44f
Fix docstrings, add examples, references and tests to string functions
author | Thorsten Meyer <thorsten.meyier@gmx.de> |
---|---|
date | Mon, 05 Jan 2009 08:11:03 +0100 |
parents | 83a8781b529d |
children | bc982528de11 |
line wrap: on
line diff
--- a/scripts/strings/findstr.m +++ b/scripts/strings/findstr.m @@ -25,11 +25,14 @@ ## can include overlapping positions (this is the default). For example, ## ## @example +## @group ## findstr ("ababab", "a") -## @result{} [ 1, 3, 5 ] +## @result{} [1, 3, 5] ## findstr ("abababa", "aba", 0) -## @result{} [ 1, 5 ] +## @result{} [1, 5] +## @end group ## @end example +## @seealso{strfind, strmatch, strcmp, strncmp, strcmpi, strncmpi, find} ## @end deftypefn ## Note that this implementation swaps the strings if second one is longer @@ -129,7 +132,7 @@ endfunction -%!assert((findstr ("abababa", "a") == [1, 3, 5, 7] +%!assert ((findstr ("abababa", "a") == [1, 3, 5, 7] %! && findstr ("abababa", "aba") == [1, 3, 5] %! && findstr ("abababa", "aba", 0) == [1, 5]));