annotate doc/interpreter/strings.txi @ 7018:fd42779a8428

[project @ 2007-10-13 00:52:12 by jwe]
author jwe
date Sat, 13 Oct 2007 00:52:13 +0000
parents 8b0cfeb06365
children 120f3135952f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7018
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
1 @c Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005,
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
2 @c 2006, 2007 John W. Eaton
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
3 @c
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
4 @c This file is part of Octave.
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
5 @c
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
6 @c Octave is free software; you can redistribute it and/or modify it
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
7 @c under the terms of the GNU General Public License as published by the
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
8 @c Free Software Foundation; either version 3 of the License, or (at
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
9 @c your option) any later version.
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
10 @c
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
11 @c Octave is distributed in the hope that it will be useful, but WITHOUT
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
12 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
13 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
14 @c for more details.
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
15 @c
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
16 @c You should have received a copy of the GNU General Public License
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
17 @c along with Octave; see the file COPYING. If not, see
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 7001
diff changeset
18 @c <http://www.gnu.org/licenses/>.
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
19
4167
aae05d51353c [project @ 2002-11-12 02:52:50 by jwe]
jwe
parents: 3920
diff changeset
20 @node Strings
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
21 @chapter Strings
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
22 @cindex strings
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
23 @cindex character strings
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
24 @opindex "
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
25 @opindex '
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
26
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
27 A @dfn{string constant} consists of a sequence of characters enclosed in
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
28 either double-quote or single-quote marks. For example, both of the
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
29 following expressions
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
30
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
31 @example
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
32 @group
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
33 "parrot"
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
34 'parrot'
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
35 @end group
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
36 @end example
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
37
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
38 @noindent
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
39 represent the string whose contents are @samp{parrot}. Strings in
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
40 Octave can be of any length.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
41
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
42 Since the single-quote mark is also used for the transpose operator
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
43 (@pxref{Arithmetic Ops}) but double-quote marks have no other purpose in
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
44 Octave, it is best to use double-quote marks to denote strings.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
45
6554
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
46 @cindex escape sequence notation
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
47 In double-quoted strings, the backslash character is used to introduce
6623
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
48 @dfn{escape sequences} that represent other characters. For example,
6554
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
49 @samp{\n} embeds a newline character in a double-quoted string and
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
50 @samp{\"} embeds a double quote character.
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
51
6554
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
52 In single-quoted strings, backslash is not a special character.
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
53
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
54 Here is an example showing the difference
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
55
6554
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
56 @example
6556
8810bbf321ce [project @ 2007-04-20 18:39:40 by jwe]
jwe
parents: 6554
diff changeset
57 @group
6554
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
58 toascii ("\n")
6570
49f0820425a8 [project @ 2007-04-24 23:06:56 by jwe]
jwe
parents: 6556
diff changeset
59 @result{} 10
6554
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
60 toascii ('\n')
6570
49f0820425a8 [project @ 2007-04-24 23:06:56 by jwe]
jwe
parents: 6556
diff changeset
61 @result{} [ 92 110 ]
6556
8810bbf321ce [project @ 2007-04-20 18:39:40 by jwe]
jwe
parents: 6554
diff changeset
62 @end group
6554
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
63 @end example
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
64
6554
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
65 You may also insert a single quote character in a single-quoted string
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
66 by using two single quote characters in succession. For example,
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
67
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
68 @example
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
69 'I can''t escape'
6570
49f0820425a8 [project @ 2007-04-24 23:06:56 by jwe]
jwe
parents: 6556
diff changeset
70 @result{} I can't escape
6554
5dde4dc2bcaf [project @ 2007-04-20 17:16:50 by jwe]
jwe
parents: 6549
diff changeset
71 @end example
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
72
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
73 Here is a table of all the escape sequences used in Octave. They are
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
74 the same as those used in the C programming language.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
75
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
76 @table @code
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
77 @item \\
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
78 Represents a literal backslash, @samp{\}.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
79
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
80 @item \"
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
81 Represents a literal double-quote character, @samp{"}.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
82
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
83 @item \'
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
84 Represents a literal single-quote character, @samp{'}.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
85
3893
abd8659eea11 [project @ 2002-04-09 21:36:31 by jwe]
jwe
parents: 3428
diff changeset
86 @item \0
4946
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4535
diff changeset
87 Represents the ``nul'' character, control-@@, ASCII code 0.
3893
abd8659eea11 [project @ 2002-04-09 21:36:31 by jwe]
jwe
parents: 3428
diff changeset
88
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
89 @item \a
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
90 Represents the ``alert'' character, control-g, ASCII code 7.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
91
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
92 @item \b
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
93 Represents a backspace, control-h, ASCII code 8.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
94
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
95 @item \f
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
96 Represents a formfeed, control-l, ASCII code 12.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
97
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
98 @item \n
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
99 Represents a newline, control-j, ASCII code 10.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
100
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
101 @item \r
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
102 Represents a carriage return, control-m, ASCII code 13.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
103
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
104 @item \t
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
105 Represents a horizontal tab, control-i, ASCII code 9.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
106
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
107 @item \v
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
108 Represents a vertical tab, control-k, ASCII code 11.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
109
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
110 @c We don't do octal or hex this way yet.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
111 @c
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
112 @c @item \@var{nnn}
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
113 @c Represents the octal value @var{nnn}, where @var{nnn} are one to three
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
114 @c digits between 0 and 7. For example, the code for the ASCII ESC
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
115 @c (escape) character is @samp{\033}.@refill
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
116 @c
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
117 @c @item \x@var{hh}@dots{}
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
118 @c Represents the hexadecimal value @var{hh}, where @var{hh} are hexadecimal
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
119 @c digits (@samp{0} through @samp{9} and either @samp{A} through @samp{F} or
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
120 @c @samp{a} through @samp{f}). Like the same construct in @sc{ansi} C,
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
121 @c the escape
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
122 @c sequence continues until the first non-hexadecimal digit is seen. However,
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
123 @c using more than two hexadecimal digits produces undefined results. (The
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
124 @c @samp{\x} escape sequence is not allowed in @sc{posix} @code{awk}.)@refill
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
125 @end table
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
126
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
127 Strings may be concatenated using the notation for defining matrices.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
128 For example, the expression
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
129
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
130 @example
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
131 [ "foo" , "bar" , "baz" ]
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
132 @end example
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
133
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
134 @noindent
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
135 produces the string whose contents are @samp{foobarbaz}. @xref{Numeric
3402
9610d364e444 [project @ 2000-01-05 04:36:38 by jwe]
jwe
parents: 3361
diff changeset
136 Data Types}, for more information about creating matrices.
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
137
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
138 @menu
6624
0d69a50fc5a9 [project @ 2007-05-15 20:17:27 by jwe]
jwe
parents: 6623
diff changeset
139 * Creating Strings::
0d69a50fc5a9 [project @ 2007-05-15 20:17:27 by jwe]
jwe
parents: 6623
diff changeset
140 * Comparing Strings::
0d69a50fc5a9 [project @ 2007-05-15 20:17:27 by jwe]
jwe
parents: 6623
diff changeset
141 * Manipulating Strings::
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
142 * String Conversions::
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
143 * Character Class Functions::
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
144 @end menu
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
145
4167
aae05d51353c [project @ 2002-11-12 02:52:50 by jwe]
jwe
parents: 3920
diff changeset
146 @node Creating Strings
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
147 @section Creating Strings
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
148
6623
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
149 The easiest way to create a string is, as illustrated in the introduction,
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
150 to enclose a text in double-quotes or single-quotes. It is however
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
151 possible to create a string without actually writing a text. The
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
152 function @code{blanks} creates a string of a given length consisting
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
153 only of blank characters (ASCII code 32).
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
154
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
155 @DOCSTRING(blanks)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
156
6623
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
157 The string representation used by Octave is an array of characters, so
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
158 the result of @code{blanks(10)} is actually a row vector of length 10
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
159 containing the value 32 in all places. This lends itself to the obvious
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
160 generalisation to character matrices. Using a matrix of characters, it
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
161 is possible to represent a collection of same-length strings in one
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
162 variable. The convention used in Octave is that each row in a
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
163 character matrix is a separate string, but letting each column represent
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
164 a string is equally possible.
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
165
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
166 The easiest way to create a character matrix is to put several strings
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
167 together into a matrix.
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
168
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
169 @example
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
170 collection = [ "String #1"; "String #2" ];
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
171 @end example
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
172
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
173 @noindent
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
174 This creates a 2-by-9 character matrix.
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
175
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
176 One relevant question is, what happens when character matrix is
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
177 created from strings of different length. The answer is that Octave
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
178 puts blank characters at the end of strings shorter than the longest
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
179 string. While it is possible to use a different character than the
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
180 blank character using the @code{string_fill_char} function, it shows
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
181 a problem with character matrices. It simply isn't possible to
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
182 represent strings of different lengths. The solution is to use a cell
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
183 array of strings, which is described in @ref{Cell Arrays of Strings}.
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
184
4358
83d4452bc522 [project @ 2003-02-23 02:16:53 by jwe]
jwe
parents: 4167
diff changeset
185 @DOCSTRING(char)
83d4452bc522 [project @ 2003-02-23 02:16:53 by jwe]
jwe
parents: 4167
diff changeset
186
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
187 @DOCSTRING(strcat)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
188
6502
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
189 @DOCSTRING(strvcat)
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
190
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
191 @DOCSTRING(strtrunc)
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
192
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
193 @DOCSTRING(string_fill_char)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
194
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
195 @DOCSTRING(str2mat)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
196
4535
a5f23212a3d8 [project @ 2003-10-16 02:39:15 by jwe]
jwe
parents: 4452
diff changeset
197 @DOCSTRING(ischar)
a5f23212a3d8 [project @ 2003-10-16 02:39:15 by jwe]
jwe
parents: 4452
diff changeset
198
6502
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
199 @DOCSTRING(mat2str)
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
200
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
201 @DOCSTRING(num2str)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
202
6623
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
203 @DOCSTRING(int2str)
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
204
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
205 @node Comparing Strings
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
206 @section Comparing Strings
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
207
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
208 Since a string is a character array comparison between strings work
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
209 element by element as the following example shows.
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
210
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
211 @example
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
212 GNU = "GNU's Not UNIX";
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
213 spaces = (GNU == " ")
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
214 @result{} spaces =
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
215 0 0 0 0 0 1 0 0 0 1 0 0 0 0
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
216 @end example
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
217
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
218 @noindent
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
219 To determine if two functions are identical it is therefore necessary
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
220 to use the @code{strcmp} or @code{strncpm} functions. Similar
7001
8b0cfeb06365 [project @ 2007-10-10 18:02:59 by jwe]
jwe
parents: 6778
diff changeset
221 functions exist for doing case-insensitive comparisons.
6623
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
222
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
223 @DOCSTRING(strcmp)
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
224
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
225 @DOCSTRING(strcmpi)
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
226
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
227 @DOCSTRING(strncmp)
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
228
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
229 @DOCSTRING(strncmpi)
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
230
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
231 @node Manipulating Strings
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
232 @section Manipulating Strings
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
233
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
234 Octave supports a wide range of functions for manipulating strings.
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
235 Since a string is just a matrix, simple manipulations can be accomplished
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
236 using standard operators. The following example shows how to replace
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
237 all blank characters with underscores.
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
238
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
239 @example
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
240 quote = "First things first, but not necessarily in that order";
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
241 quote( quote == " " ) = "_"
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
242 @print{} quote = First_things_first,_but_not_necessarily_in_that_order
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
243 @end example
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
244
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
245 For more complex manipulations, such as searching, replacing, and
7001
8b0cfeb06365 [project @ 2007-10-10 18:02:59 by jwe]
jwe
parents: 6778
diff changeset
246 general regular expressions, the following functions come with Octave.
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
247
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
248 @DOCSTRING(deblank)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
249
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
250 @DOCSTRING(findstr)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
251
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
252 @DOCSTRING(index)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
253
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
254 @DOCSTRING(rindex)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
255
6502
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
256 @DOCSTRING(strfind)
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
257
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
258 @DOCSTRING(strmatch)
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
259
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
260 @DOCSTRING(strtok)
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
261
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
262 @DOCSTRING(split)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
263
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
264 @DOCSTRING(strrep)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
265
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
266 @DOCSTRING(substr)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
267
5582
6bf56668b01a [project @ 2005-12-15 01:08:20 by jwe]
jwe
parents: 4946
diff changeset
268 @DOCSTRING(regexp)
6bf56668b01a [project @ 2005-12-15 01:08:20 by jwe]
jwe
parents: 4946
diff changeset
269
6bf56668b01a [project @ 2005-12-15 01:08:20 by jwe]
jwe
parents: 4946
diff changeset
270 @DOCSTRING(regexpi)
6bf56668b01a [project @ 2005-12-15 01:08:20 by jwe]
jwe
parents: 4946
diff changeset
271
6549
5a5a09d7deb8 [project @ 2007-04-20 06:55:29 by jwe]
jwe
parents: 6502
diff changeset
272 @DOCSTRING(regexprep)
5a5a09d7deb8 [project @ 2007-04-20 06:55:29 by jwe]
jwe
parents: 6502
diff changeset
273
4167
aae05d51353c [project @ 2002-11-12 02:52:50 by jwe]
jwe
parents: 3920
diff changeset
274 @node String Conversions
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
275 @section String Conversions
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
276
6623
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
277 Octave supports various kinds of conversions between strings and
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
278 numbers. As an example, it is possible to convert a string containing
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
279 a hexadecimal number to a floating point number.
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
280
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
281 @example
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
282 hex2dec ("FF")
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
283 @result{} ans = 255
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
284 @end example
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
285
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
286 @DOCSTRING(bin2dec)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
287
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
288 @DOCSTRING(dec2bin)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
289
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
290 @DOCSTRING(dec2hex)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
291
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
292 @DOCSTRING(hex2dec)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
293
3920
87db95b22f8f [project @ 2002-05-01 04:07:31 by jwe]
jwe
parents: 3893
diff changeset
294 @DOCSTRING(dec2base)
87db95b22f8f [project @ 2002-05-01 04:07:31 by jwe]
jwe
parents: 3893
diff changeset
295
87db95b22f8f [project @ 2002-05-01 04:07:31 by jwe]
jwe
parents: 3893
diff changeset
296 @DOCSTRING(base2dec)
87db95b22f8f [project @ 2002-05-01 04:07:31 by jwe]
jwe
parents: 3893
diff changeset
297
6623
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
298 @DOCSTRING(str2double)
3920
87db95b22f8f [project @ 2002-05-01 04:07:31 by jwe]
jwe
parents: 3893
diff changeset
299
6623
545847da3b88 [project @ 2007-05-15 02:23:08 by jwe]
jwe
parents: 6570
diff changeset
300 @DOCSTRING(strjust)
6502
6ab0a8767780 [project @ 2007-04-06 03:32:06 by jwe]
jwe
parents: 6501
diff changeset
301
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
302 @DOCSTRING(str2num)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
303
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
304 @DOCSTRING(toascii)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
305
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
306 @DOCSTRING(tolower)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
307
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
308 @DOCSTRING(toupper)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
309
3428
5b77cf82393c [project @ 2000-01-14 02:54:53 by jwe]
jwe
parents: 3402
diff changeset
310 @DOCSTRING(do_string_escapes)
5b77cf82393c [project @ 2000-01-14 02:54:53 by jwe]
jwe
parents: 3402
diff changeset
311
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
312 @DOCSTRING(undo_string_escapes)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
313
4167
aae05d51353c [project @ 2002-11-12 02:52:50 by jwe]
jwe
parents: 3920
diff changeset
314 @node Character Class Functions
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
315 @section Character Class Functions
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
316
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
317 Octave also provides the following character class test functions
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
318 patterned after the functions in the standard C library. They all
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
319 operate on string arrays and return matrices of zeros and ones.
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
320 Elements that are nonzero indicate that the condition was true for the
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
321 corresponding character in the string array. For example,
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
322
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
323 @example
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
324 @group
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
325 isalpha ("!Q@@WERT^Y&")
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
326 @result{} [ 0, 1, 0, 1, 1, 1, 1, 0, 1, 0 ]
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
327 @end group
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
328 @end example
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
329
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
330 @DOCSTRING(isalnum)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
331
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
332 @DOCSTRING(isalpha)
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
333
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
334 @DOCSTRING(isascii)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
335
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
336 @DOCSTRING(iscntrl)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
337
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
338 @DOCSTRING(isdigit)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
339
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
340 @DOCSTRING(isgraph)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
341
6549
5a5a09d7deb8 [project @ 2007-04-20 06:55:29 by jwe]
jwe
parents: 6502
diff changeset
342 @DOCSTRING(isletter)
5a5a09d7deb8 [project @ 2007-04-20 06:55:29 by jwe]
jwe
parents: 6502
diff changeset
343
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
344 @DOCSTRING(islower)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
345
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
346 @DOCSTRING(isprint)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
347
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
348 @DOCSTRING(ispunct)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
349
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
350 @DOCSTRING(isspace)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
351
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
352 @DOCSTRING(isupper)
3294
bfe1573bd2ae [project @ 1999-10-19 10:06:07 by jwe]
jwe
parents:
diff changeset
353
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3294
diff changeset
354 @DOCSTRING(isxdigit)