DSSSL Library Reference: Part of the Modular DocBook Stylesheet distribution
Prev |  | Next

# length-string-unit-part

## Name

length-string-unit-part -- Returns the unit part of a length string

## Synopsis

    (length-string-unit-part lenstr)

## Description

Given a length as a string, return the units part.

## Example

`"100pt"` returns `"pt"`. `"30"` returns `""`. `"in"` returns `"in"`.

## Author

Norman Walsh, <ndw@nwalsh.com>

## Source Code

    (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))))

Prev | Home | Next
length-string-number-part | Up | normalize