1 % Copyright (C) 2008 Bert Burgemeister
3 % Permission is granted to copy, distribute and/or modify this
4 % document under the terms of the GNU Free Documentation License,
5 % Version 1.2 or any later version published by the Free Software
6 % Foundation; with no Invariant Sections, no Front-Cover Texts and
7 % no Back-Cover Texts. For details see file COPYING.
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13 Strings can as well be manipulated by array and sequence functions,
14 see pages
\pageref{section:Sequences
} and
\pageref{section:Arrays
}.
19 \IT{\arrGOO{(
\FU*
{STRINGP
} \VAR{ foo
})\\
20 (
\FU*
{SIMPLE-STRING-P
} \VAR{ foo
})
}{\
}}}
21 Return
\retval{\T} if
\VAR{foo
} is of type
22 \kwd{string
} or
\kwd{simple-string
}, resp.
24 \IT{(
\xorGOO{\FU*
{STRING=
}\\
\FU*
{STRING-EQUAL
}}{\
}} \VAR{foo
}
26 \orGOO{\kwd{:start1
} \VAR{ start-foo
}\DF{\LIT{0}}\\
27 \kwd{:end1
} \VAR{ end-foo
}\DF{\LIT{\NIL}}\\
28 \kwd{:start2
} \VAR{ start-bar
}\DF{\LIT{0}}\\
29 \kwd{:end2
} \VAR{ end-bar
}\DF{\LIT{\NIL}}}{\
}})
}
31 subsequences of
\VAR{foo
} and
\VAR{bar
} are equal. Obey/ignore,
34 \IT{(
\xorGOO{\FU*
{STRING/=
}\\
\FU{STRING
\boldmath$>$
}\\
35 \FU{STRING
\boldmath$>=$
}\\
\FU{STRING
\boldmath$<$
}\\
36 \FU{STRING
\boldmath$<=$
}}{\
}} \VAR{foo
} \VAR{bar
}
37 \orGOO{\kwd{:start1
} \VAR{ start-foo
}\DF{\LIT{0}}\\
38 \kwd{:end1
} \VAR{ end-foo
}\DF{\LIT{\NIL}}\\
39 \kwd{:start2
} \VAR{ start-bar
}\DF{\LIT{0}}\\
40 \kwd{:end2
} \VAR{ end-bar
}\DF{\LIT{\NIL}}}{\
}})
}
41 \index{string>@STRING
\boldmath$>$
}%
42 \index{string>=@STRING
\boldmath$>=$
}%
43 \index{string<@STRING
\boldmath$<$
}%
44 \index{string<=@STRING
\boldmath$<=$
}%
46 lexicographically not equal, greater, not less, less, or not greater,
47 resp., then return
\retval{character number
} from beginning of
\VAR{foo
}
48 where they begin to differ. Otherwise return
\retval{\NIL}.
50 \IT{(
\xorGOO{\FU*
{STRING-NOT-EQUAL
}\\
51 \FU*
{STRING-GREATERP
}\\
52 \FU*
{STRING-NOT-LESSP
}\\
54 \FU*
{STRING-NOT-GREATERP
}}{\
}}
57 \kwd{:start1
} \VAR{ start-foo
}\DF{\LIT{0}}\\
58 \kwd{:end1
} \VAR{ end-foo
}\DF{\LIT{\NIL}}\\
59 \kwd{:start2
} \VAR{ start-bar
}\DF{\LIT{0}}\\
60 \kwd{:end2
} \VAR{ end-bar
}\DF{\LIT{\NIL}}}{\
}})
}
62 lexicographically not equal, greater, not less, less, or not greater,
63 resp., ignoring case, then return
\retval{character number
} from beginning of
\VAR{foo
}
64 where they begin to differ. Otherwise return
\retval{\NIL}.
66 \IT{(
\FU*
{STRING
} \VAR{x
})
}
67 Convert
\VAR{x
} (symbol, string, or character) into a
\retval{string
}.
69 \IT{(
\FU*
{MAKE-STRING
} \VAR{size
} \orGOO{\kwd{initial-element
} \VAR{ char
}\\
70 \kwd{element-type
} \VAR{ type
}\DF{\kwd{character
}}}{\
}})
}
71 Return
\retval{string
} of length
\VAR{size
}.
73 \IT{(
\xorGOO{\FU*
{STRING
}\\
\FU*
{NSTRING
}}{\
}}\kwd{-
}%
74 \xorGOO{\kwd{CAPITALIZE
}\\
\kwd{UPCASE
}
77 \orGOO{\kwd{:start
} \VAR{ start
}\DF{\LIT{0}}\\
78 \kwd{:end
} \VAR{ end
}\DF{\NIL}}{\
}})
}
79 \index{STRING-CAPITALIZE
}%
80 \index{STRING-UPCASE
}%
81 \index{STRING-DOWNCASE
}%
82 \index{NSTRING-CAPITALIZE
}%
83 \index{NSTRING-UPCASE
}%
84 \index{NSTRING-DOWNCASE
}%
85 Return
\retval{\VAR{string
}} (not modified or modified, resp.) with
86 first letter of every word turned into uppercase, all letters
87 uppercase, or all letters lowercase, resp.
89 \IT{(
\xorGOO{\FU*
{STRING-TRIM
}\\
90 \FU*
{STRING-LEFT-TRIM
}\\
91 \FU*
{STRING-RIGHT-TRIM
}}{\
}} \VAR{char-bag
} \VAR{string
})
}
92 Return
\retval{string
} with all characters in
\VAR{char-bag
} removed
93 from both ends, from the beginning, or from the end, resp., of
\VAR{string
}.
95 \IT{\arrGOO{(
\FU*
{CHAR
} \VAR{ string
} \VAR{ i
})\\
96 (
\FU*
{SCHAR
} \VAR{ string
} \VAR{ i
})
}{\
}}}
97 Return
\retval{\VAR{i
}th character
} of string ignoring/obeying,
98 resp., fill pointer.
\kwd{setf
}able.
100 \IT{(
\FU*
{PARSE-INTEGER
} \VAR{string
}
101 \orGOO{\kwd{:start
} \VAR{ start
}\DF{\LIT{0}}\\
102 \kwd{:end
} \VAR{ end
}\DF{\NIL}\\
103 \kwd{:junk-allowed
} \VAR{ bool
}\DF{\NIL}}{\
}})
}
104 Parse
\retval{integer
} from
\VAR{string
}. Second value is
105 \retvalii{index
} of parse end in
\VAR{string
}.