I've done this and it works but...is there a slicker way :)

(setq S " this contains 2  consecutive spaces ")

(de shrink (Str)
   #can't clip before inner pack so need to pack, chop, clip and re-pack
   (pack
      (clip
         (chop
            (pack
               (let (Last_ch " ")
               (make
                  (for Ch (chop Str)
                     (if (<> Ch " ")
                        (if (= Last_ch " ")
                           (link (pack " " Ch))
                           (link Ch)))
                     (setq Last_ch Ch)))))))))


(prinl "'" (shrink S) "'")

#'this contains 2 consecutive spaces'

Reply via email to