summaryrefslogtreecommitdiffstats
path: root/apps/aux/strings.scm
blob: 70047216138413bd6341886b3085b75f7a25c1f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
;;; Harmonic Flow web site

(define-module (apps aux strings)
  #:export (string-summarize))


(define (string-summarize string n)
  "Return an extract of N words from the given STRING."
  (let ((words (string-split string #\space)))
    (if (<= (length words) n)
	string
	(string-join (list-head words n) " "))))