annotate scripts/strings/lower.m @ 7948:af10baa63915 ss-3-1-50

3.1.50 snapshot
author John W. Eaton <jwe@octave.org>
date Fri, 18 Jul 2008 17:42:48 -0400
parents a1dbe9d80eee
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
1 ## Copyright (C) 1998, 2000, 2004, 2005, 2006, 2007 John W. Eaton
3175
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
2 ##
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
4 ##
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6046
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6046
diff changeset
8 ## your option) any later version.
3175
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
9 ##
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
14 ##
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6046
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6046
diff changeset
17 ## <http://www.gnu.org/licenses/>.
3175
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
18
3446
5ee5afb3981a [project @ 2000-01-17 09:42:43 by jwe]
jwe
parents: 3407
diff changeset
19 ## -*- texinfo -*-
3499
3e3e14ad5149 [project @ 2000-01-31 05:18:07 by jwe]
jwe
parents: 3446
diff changeset
20 ## @deftypefn {Function File} {} lower (@var{s})
5676
9c9eac3a6513 [project @ 2006-03-16 04:09:07 by jwe]
jwe
parents: 5642
diff changeset
21 ## Transform all letters in the character string (or cell array of
9c9eac3a6513 [project @ 2006-03-16 04:09:07 by jwe]
jwe
parents: 5642
diff changeset
22 ## character strings) @var{s} to lower case.
9c9eac3a6513 [project @ 2006-03-16 04:09:07 by jwe]
jwe
parents: 5642
diff changeset
23 ## @seealso{upper, tolower, toupper}
3407
5e0a0b1cba43 [project @ 2000-01-06 03:13:55 by jwe]
jwe
parents: 3175
diff changeset
24 ## @end deftypefn
3175
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
25
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
26 ## Author: jwe
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
27
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
28 function retval = lower (s)
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
29
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
30 if (nargin != 1)
6046
34f96dd5441b [project @ 2006-10-10 16:10:25 by jwe]
jwe
parents: 6023
diff changeset
31 print_usage ();
3175
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
32 endif
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
33
5676
9c9eac3a6513 [project @ 2006-03-16 04:09:07 by jwe]
jwe
parents: 5642
diff changeset
34 if (ischar (s))
9c9eac3a6513 [project @ 2006-03-16 04:09:07 by jwe]
jwe
parents: 5642
diff changeset
35 retval = tolower (s);
9c9eac3a6513 [project @ 2006-03-16 04:09:07 by jwe]
jwe
parents: 5642
diff changeset
36 elseif (iscellstr (s))
6023
75a828280d68 [project @ 2006-10-03 02:14:21 by jwe]
jwe
parents: 5676
diff changeset
37 retval = cellfun (@tolower, s, "UniformOutput", false);
5676
9c9eac3a6513 [project @ 2006-03-16 04:09:07 by jwe]
jwe
parents: 5642
diff changeset
38 else
9c9eac3a6513 [project @ 2006-03-16 04:09:07 by jwe]
jwe
parents: 5642
diff changeset
39 error ("lower: `s' must be a string or cell array of strings");
9c9eac3a6513 [project @ 2006-03-16 04:09:07 by jwe]
jwe
parents: 5642
diff changeset
40 endif
3175
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
41
096940972434 [project @ 1998-05-18 17:03:01 by jwe]
jwe
parents:
diff changeset
42 endfunction