Mercurial > hg > octave-nkf
comparison scripts/strings/strcmp.m @ 3361:4f40efa995c1
[project @ 1999-11-19 21:19:37 by jwe]
author | jwe |
---|---|
date | Fri, 19 Nov 1999 21:19:44 +0000 |
parents | 8b262e771614 |
children | f8dde1807dee |
comparison
equal
deleted
inserted
replaced
3360:48bd8127e19b | 3361:4f40efa995c1 |
---|---|
15 ## You should have received a copy of the GNU General Public License | 15 ## You should have received a copy of the GNU General Public License |
16 ## along with Octave; see the file COPYING. If not, write to the Free | 16 ## along with Octave; see the file COPYING. If not, write to the Free |
17 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA | 17 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA |
18 ## 02111-1307, USA. | 18 ## 02111-1307, USA. |
19 | 19 |
20 ## usage: strcmp (s1, s2) | 20 ## -*- texinfo -*- |
21 ## | 21 ## @deftypefn {Function File} {} strcmp (@var{s1}, @var{s2}) |
22 ## Compare two strings. Trailing blanks are significant. | 22 ## Compares two strings, returning 1 if they are the same, and 0 otherwise. |
23 ## | 23 ## |
24 ## WARNING: Unlike the C function of the same name, this function | 24 ## @strong{Note:} For compatibility with @sc{Matlab}, Octave's strcmp |
25 ## returns 1 for equal and zero for not equal. Why? To be compatible | 25 ## function returns 1 if the strings are equal, and 0 otherwise. This is |
26 ## with Matlab, of course. | 26 ## just the opposite of the corresponding C library function. |
27 ## | 27 ## @end deftypefn |
28 ## Why doesn't this always return a scalar instead of vector with | |
29 ## elements corresponding to the rows of the string array? To be | |
30 ## compatible with Matlab, of course. | |
31 | 28 |
32 ## Author: jwe | 29 ## Author: jwe |
33 | 30 |
34 function status = strcmp (s1, s2) | 31 function status = strcmp (s1, s2) |
35 | 32 |