fillChar method

String fillChar(
  1. String value,
  2. String char
)

Implementation

String fillChar(String value, String char) {
  int offset = value.length - length;
  String newVal = this;
  if (offset > 0) {
    for (int i = 0; i < offset; i++) {
      newVal = char + newVal;
    }
  }
  return newVal;
}