<RefEntry id="length-string-unit-part">
<!-- This file is generated automatically from the DSSSL source. -->
<!-- Do not edit this file! -->
<?html-filename length-string-unit-part.html>

<RefMeta>
  <RefEntryTitle>length-string-unit-part</RefEntryTitle>
  <RefMiscInfo Role="file">dblib.dsl</RefMiscInfo>
</RefMeta>

<RefNameDiv>
  <RefName>length-string-unit-part</RefName>
  <RefPurpose>Returns the unit part of a length string</RefPurpose>
</RefNameDiv>

<RefSynopsisDiv><Title>Synopsis</Title>
<Synopsis>
(length-string-unit-part lenstr)
</Synopsis>
</RefSynopsisDiv>

<RefSect1><Title>Description</Title>

<para>
Given a length as a string, return the units part.</para>


</RefSect1>

<RefSect1><Title>Example</Title>

<para>
<literal>"100pt"</literal> returns <literal>"pt"</literal>. <literal>"30"</literal> returns <literal>""</literal>.  
<literal>"in"</literal> returns <literal>"in"</literal>.
</para>


</RefSect1>

<RefSect1><Title>Author</Title>

<para>
Norman Walsh, &lt;ndw@nwalsh.com&gt;
</para>
</RefSect1>
<RefSect1><Title>Source Code</Title>

<ProgramListing>
(define (length-string-unit-part lenstr)
  ;; Returns the unit part of a length string
  (let ((number-part (length-string-number-part lenstr))
	(strlen (string-length lenstr)))
    (if (equal? (string-length number-part) strlen)
	""
	(substring lenstr (string-length number-part) strlen))))
</ProgramListing>
</RefSect1>

</RefEntry>
