leftpad

build Maven Central

String left pad heavily inspired by left-pad.

Install

libraryDependencies ++= List(
  "io.github.asakaev" %% "leftpad-core",
  "io.github.asakaev" %% "leftpad-refined"
).map(_ % "<version>")

Usage

import io.github.asakaev.leftpad.string._

leftPad("foo", 5)
// => "  foo"

leftPad("foobar", 6)
// => "foobar"

leftPad("1", 2, '0')
// => "01"

leftPad("17", 5, 0)
// => "00017"

License

leftpad is licensed under the MIT license.