;; お題:文字列を先頭から見て同じところまで除去 - No Programming, No Life ;; http://d.hatena.ne.jp/fumokmm/20110812/1313138407 (use srfi-13) (define (remove-string-prefix . strs) (and (not (null? strs)) (map (cut string-drop <> (apply min (map (pa$ string-prefix-length (car strs)) strs))) strs))) (remove-string-prefix "abcdef" "abc123") ;; -> ("def" "123") (remove-string-prefix "あいうえお" "あいさんさん" "あいどる") ;; -> ("うえお" "さんさん" "どる") (remove-string-prefix "12345" "67890" "12abc") ;; -> ("12345" "67890" "12abc")