ltrim function Null safety
trim characters from the left-side of the input
Implementation
String ltrim(String str, [String? chars]) {
var pattern = chars != null ? RegExp('^[$chars]+') : RegExp(r'^\s+');
return str.replaceAll(pattern, '');
}
trim characters from the left-side of the input
String ltrim(String str, [String? chars]) {
var pattern = chars != null ? RegExp('^[$chars]+') : RegExp(r'^\s+');
return str.replaceAll(pattern, '');
}