/left-pad.clj

clojure/clojurescript port of left-pad: https://github.com/azer/left-pad

Primary LanguageClojureMIT LicenseMIT

left-pad.clj

Circle CI GitHub license

String left pad.

This library is clojure/clojurescript port of left-pad, it's NOT recommand to use this library actually :).

Clojars Project

Latest codox API docs.

Dependencies

This library is designed for both Clojure/ClojureSript, you need following minimal version:

  • Clojure 1.8.0 ↑
  • ClojureScript 1.8.34 ↑

Usage

(ns left-pad-test.core
  (:require [coldnew.left-pad :refer [leftpad]))

(leftpad "foo" 5)
;; => "  foo"

(leftpad "foobar" 6)
;; => "foobar"

(leftpad 1 2 0)
;; => "01"

Testing

This library test with speclj, to test with Clojure, use following command:

$ lein spec

If you want to test in ClojureScript, use below

$ lein cljsbuild test

License

Copyright © 2016 Yen-Chin, Lee <coldnew.tw@gmail.com>

Distributed under the MIT License.