trimStringLeft method
Trims the characters given by chars
from before String.
Stringの前からchars
で与えられた文字をトリムします。
final text = "__text___";
final trimed = text.trimString("_"); // "text___"
Implementation
String trimStringLeft(String chars) {
final pattern = chars.isNotEmpty ? RegExp("^[$chars]+") : RegExp(r"^\s+");
return replaceAll(pattern, "");
}