1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
<RefEntry id="string-with-space">
<!-- This file is generated automatically from the DSSSL source. -->
<!-- Do not edit this file! -->
<?html-filename string-with-space.html>
<RefMeta>
<RefEntryTitle>string-with-space</RefEntryTitle>
<RefMiscInfo Role="file">dblib.dsl</RefMiscInfo>
</RefMeta>
<RefNameDiv>
<RefName>string-with-space</RefName>
<RefPurpose>Returns string with a space appended or the empty string</RefPurpose>
</RefNameDiv>
<RefSynopsisDiv><Title>Synopsis</Title>
<Synopsis>
(string-with-space string #!optional (space " "))
</Synopsis>
</RefSynopsisDiv>
<RefSect1><Title>Description</Title>
<para>
If <literal>string</literal> is not the empty string, returns <literal>string</literal> with a
<literal>space</literal> appended. If <literal>string</literal> is empty, or is not a <literal>(string?)</literal>,
returns <literal>string</literal> unmodified.
</para>
<variablelist>
<varlistentry><term><literal>string</literal></term>
<listitem>
<para>
The string onto which a space should be appended.
</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>space</literal></term>
<listitem>
<para>
If specified, the space to append. Defaults to a single space.
</para>
</listitem>
</varlistentry>
</variablelist>
</RefSect1>
<RefSect1><Title>Author</Title>
<para>
Norman Walsh, <ndw@nwalsh.com>
</para>
</RefSect1>
<RefSect1><Title>Source Code</Title>
<ProgramListing>
(define (string-with-space string #!optional (space " "))
;; Returns string with a space appended or the empty string
(if (string? string)
(if (equal? string "")
string
(string-append string space))
string))
</ProgramListing>
</RefSect1>
</RefEntry>
|