/[lispfaq]/lispfaq/stringsplit.xml
ViewVC logotype

Contents of /lispfaq/stringsplit.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Mon Mar 22 18:55:25 2004 UTC (10 years, 1 month ago) by emarsden
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/xml
 - huge jump in technology from the SGML version of Docbook using the DSSSL
   stylesheets, to the new and improved XML version with XSL stylesheets.
   Ahem.
1 <qandaentry>
2 <question>
3 <para>How do I split a string?</para>
4 </question>
5 <answer>
6 <para>
7 There is no `right' answer to this question; many lisp
8 programmers have rolled their own solution in the past, and
9 others are of the view that it should never be necessary, as
10 long as all sequence functions are used with consistent :start
11 and :end arguments.
12 </para>
13 <para>
14 However, a community-based `standard' was developed in June/July
15 2001 on <ulink url="news:comp.lang.lisp">comp.lang.lisp</ulink>;
16 known as SPLIT-SEQUENCE (formerly PARTITION), it works as
17 follows in its simplest form:
18 </para>
19 <para>
20 <userinput>(split-sequence #\Space "A stitch in time saves
21 nine.")</userinput> gives <computeroutput>("A" "stitch" "in"
22 "time" "saves" "nine."), 28</computeroutput>
23 </para>
24 <para>
25 For more details, consult the specification, available from
26 <ulink url="http://ww.telent.net/cliki/SPLIT-SEQUENCE">its CLiki
27 page</ulink>.
28 </para>
29 </answer>
30 </qandaentry>

  ViewVC Help
Powered by ViewVC 1.1.5