1 % Copyright (C) 2008, 2010 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:Arrays
} and
\pageref{section:Sequences
}.
19 \IT{\arrGOO{(
\FU*
{STRINGP
} \VAR{ foo
})\\
20 (
\FU*
{SIMPLE-STRING-P
} \VAR{ foo
})
}{.
}}
22 \retval{\T} if
\VAR{foo
} is of indicated type.
25 \IT{(
\xorGOO{\FU*
{STRING=
}\\
\FU*
{STRING-EQUAL
}}{\
}} \VAR{foo
}
27 \orGOO{\kwd{:start1
} \VAR{ start-foo
}\DF{\LIT{0}}\\
28 \kwd{:start2
} \VAR{ start-bar
}\DF{\LIT{0}}\\
29 \kwd{:end1
} \VAR{ end-foo
}\DF{\NIL}\\
30 \kwd{:end2
} \VAR{ end-bar
}\DF{\NIL}}{\
}})
}
32 Return
\retval{\T} if subsequences of
\VAR{foo
} and
\VAR{bar
} are
33 equal. Obey/ignore, respectively, case.
37 \FU{STRING
}\Goo{\kwd{/=
}\XOR\kwd{-NOT-EQUAL
}}\\
38 \FU{STRING
}\Goo{\kwd{\boldmath$>$
}\XOR\kwd{-GREATERP
}}\\
39 \FU{STRING
}\Goo{\kwd{\boldmath$>$=
}\XOR\kwd{-NOT-LESSP
}}\\
40 \FU{STRING
}\Goo{\kwd{\boldmath$<$
}\XOR\kwd{-LESSP
}}\\
41 \FU{STRING
}\Goo{\kwd{\boldmath$<$=
}\XOR\kwd{-NOT-GREATERP
}}}{\
}}
43 \orGOO{\kwd{:start1
} \VAR{ start-foo
}\DF{\LIT{0}}\\
44 \kwd{:start2
} \VAR{ start-bar
}\DF{\LIT{0}}\\
45 \kwd{:end1
} \VAR{ end-foo
}\DF{\NIL}\\
46 \kwd{:end2
} \VAR{ end-bar
}\DF{\NIL}}{\
}})
}
47 {\index{STRING/=
}\index{STRING-NOT-EQUAL
}%
48 \index{STRING>@STRING$>$
}\index{STRING-GREATERP
}%
49 \index{STRING>=@STRING$>$=
}\index{STRING-NOT-LESSP
}%
50 \index{STRING<@STRING$<$
}\index{STRING-LESSP
}%
51 \index{STRING<=@STRING$<$=
}\index{STRING-NOT-GREATERP
}%
52 If
\VAR{foo
} is lexicographically not equal, greater, not less,
53 less, or not greater, respectively, then return
\retval{position
}
54 of first mismatching character in
\VAR{foo
}. Otherwise return
55 \retval{\NIL}. Obey/ignore, respectively, case.
58 \IT{(
\FU*
{STRING
} \VAR{x
})
}
60 Convert
\VAR{x
} (
\kwd{symbol
},
\kwd{string
}, or
\kwd{character
})
61 into a
\retval{string
}.
64 \IT{(
\FU*
{MAKE-STRING
} \VAR{size
} \orGOO{\kwd{:initial-element
} \VAR{ char
}\\
65 \kwd{:element-type
} \VAR{ type
}\DF{\kwd{character
}}}{\
}})
}
67 Return
\retval{string
} of length
\VAR{size
}.
70 \IT{(
\xorGOO{\FU{STRING
}\\
71 \FU{NSTRING
}}{\
}}\kwd{-
}\xorGOO{\kwd{CAPITALIZE
}\\
75 \orGOO{\kwd{:start
} \VAR{ start
}\DF{\LIT{0}}\\
76 \kwd{:end
} \VAR{ end
}\DF{\NIL}}{\
}})
}
77 {\index{STRING-CAPITALIZE
}%
78 \index{STRING-UPCASE
}%
79 \index{STRING-DOWNCASE
}%
80 \index{NSTRING-CAPITALIZE
}%
81 \index{NSTRING-UPCASE
}%
82 \index{NSTRING-DOWNCASE
}%
83 Return
\retval{\VAR{string
}} (not modified or modified,
84 respectively) with first letter of every word turned into uppercase,
85 letters all uppercase, or letters all lowercase, respectively.
88 \IT{(
\xorGOO{\FU*
{STRING-TRIM
}\\
89 \FU*
{STRING-LEFT-TRIM
}\\
90 \FU*
{STRING-RIGHT-TRIM
}}{\
}} \VAR{char-bag
} \VAR{string
})
}
92 Return
\retval{\VAR{string
}} with all characters in sequence
93 \VAR{char-bag
} removed from both ends, from the beginning, or from
94 the end, respectively.
97 \IT{\arrGOO{(
\FU*
{CHAR
} \VAR{ string
} \VAR{ i
})\\
98 (
\FU*
{SCHAR
} \VAR{ string
} \VAR{ i
})
}{.
}}
100 Return zero-indexed
\retval{\VAR{i
}th character
} of string
101 ignoring/obeying, respectively, fill pointer.
\kwd{setf
}able.
104 \IT{(
\FU*
{PARSE-INTEGER
} \VAR{string
}
105 \orGOO{\kwd{:start
} \VAR{ start
}\DF{\LIT{0}}\\
106 \kwd{:end
} \VAR{ end
}\DF{\NIL}\\
107 \kwd{:radix
} \VAR{ int
}\DF{\LIT{10}}\\
108 \kwd{:junk-allowed
} \VAR{ bool
}\DF{\NIL}}{\
}})
}
110 Return
\retval{integer
} parsed from
\VAR{string
} and
111 \retvalii{index
} of parse end.
118 %%% TeX-master: "clqr"