Mercurial > hg > octave-lyh
comparison scripts/strings/strncmpi.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 | a1dbe9d80eee |
children | eb63fbe60fab |
comparison
equal
deleted
inserted
replaced
8441:cc3ac5eb6be3 | 8442:502e58a0d44f |
---|---|
17 ## <http://www.gnu.org/licenses/>. | 17 ## <http://www.gnu.org/licenses/>. |
18 | 18 |
19 ## -*- texinfo -*- | 19 ## -*- texinfo -*- |
20 ## @deftypefn {Function File} {} strncmpi (@var{s1}, @var{s2}, @var{n}) | 20 ## @deftypefn {Function File} {} strncmpi (@var{s1}, @var{s2}, @var{n}) |
21 ## Ignoring case, return 1 if the first @var{n} characters of character | 21 ## Ignoring case, return 1 if the first @var{n} characters of character |
22 ## strings @var{s1} and @var{s2} are the same, and 0 otherwise. | 22 ## strings (or character arrays) @var{s1} and @var{s2} are the same, and |
23 ## 0 otherwise. | |
23 ## | 24 ## |
24 ## If either @var{s1} or @var{s2} is a cell array of strings, then an array | 25 ## If either @var{s1} or @var{s2} is a cell array of strings, then an array |
25 ## of the same size is returned, containing the values described above for | 26 ## of the same size is returned, containing the values described above for |
26 ## every member of the cell array. The other argument may also be a cell | 27 ## every member of the cell array. The other argument may also be a cell |
27 ## array of strings (of the same size or with only one element), char matrix | 28 ## array of strings (of the same size or with only one element), char matrix |
28 ## or character string. | 29 ## or character string. |
29 ## | 30 ## |
30 ## @strong{Caution:} For compatibility with @sc{Matlab}, Octave's strncmpi | 31 ## @strong{Caution:} For compatibility with @sc{Matlab}, Octave's strncmpi |
31 ## function returns 1 if the character strings are equal, and 0 otherwise. | 32 ## function returns 1 if the character strings are equal, and 0 otherwise. |
42 else | 43 else |
43 print_usage (); | 44 print_usage (); |
44 endif | 45 endif |
45 | 46 |
46 endfunction | 47 endfunction |
48 | |
49 %!assert (strncmpi("abc123", "ABC456", 3), logical(1)); |