trimStringLeft method

String trimStringLeft(
  1. String chars
)

Trim only the left side with a specific string.

Specify the character string to be trimmed in chars.

Implementation

String trimStringLeft(String chars) {
  final pattern = chars.isNotEmpty ? RegExp("^[$chars]+") : RegExp(r"^\s+");
  return replaceAll(pattern, "");
}