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