Strings In Depth16 / 19
Up next

padTo

@main def main(): Unit =
  val s = "42"
  // padTo appends the fill char until the length is reached
  println(s.padTo(5, '0'))
What you're solving

pad to a fixed length