padLeft method

String padLeft(
  1. int width, [
  2. String padding = '0'
])

Transforms this into a String and pads it on the left if it is shorter than the given width.

Implementation

String padLeft(int width, [String padding = '0']) =>
    toString().padLeft(width, padding);