commentcomFormat static method

String commentcomFormat(
  1. int value,
  2. String format,
  3. String single,
  4. String full,
)

com format.

Implementation

static String commentcomFormat(
    int value, String format, String single, String full) {
  if (format.contains(single)) {
    if (format.contains(full)) {
      format =
          format.replaceAll(full, value < 10 ? '0$value' : value.toString());
    } else {
      format = format.replaceAll(single, value.toString());
    }
  }
  return format;
}