2010-08-24から1日間の記事一覧
文字列の左寄せと右寄せ。人工無脳には必須か。 (defn ljust [s n] (let [l (.length s)] (cond (< l n ) (str s (apply str (repeat (- n l) " "))) :else s))) (defn rjust [s n] (let [l (.length s)] (cond (< l n) (str (apply str (repeat (- n l) " "…
文字列の左寄せと右寄せ。人工無脳には必須か。 (defn ljust [s n] (let [l (.length s)] (cond (< l n ) (str s (apply str (repeat (- n l) " "))) :else s))) (defn rjust [s n] (let [l (.length s)] (cond (< l n) (str (apply str (repeat (- n l) " "…