regex:type-split   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/llvmti.xtm

Implementation

;; regex:type-split pair is like regex split
;; but only splits on 'first' occurence
(define regex:type-split
  (lambda (str char)
    (let ((p (regex:split str char)))
      (if (and (> (length p) 1)
               (> (length (cdr p)) 1))
          (list (car p) (apply string-append (cadr p)
                               (map (lambda (k) (string-append char k)) (cddr p))))
          p))))


Back to Index