string-with-space

Name

string-with-space -- Returns string with a space appended or the empty string

Synopsis

(string-with-space string #!optional (space " "))

Description

If string is not the empty string, returns string with a space appended. If string is empty, or is not a (string?), returns string unmodified.

string

The string onto which a space should be appended.

space

If specified, the space to append. Defaults to a single space.

Author

Norman Walsh, <ndw@nwalsh.com>

Source Code

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