trim function
Implementation
String? trim(String? target, List<String>? chars,
{bool trimWhitespace = true}) {
if (target == null) {
return null;
}
var manipulated = target;
if (trimWhitespace) {
manipulated = manipulated.trim();
}
chars?.forEach((c) {
if (manipulated.endsWith(c)) {
manipulated = manipulated.substring(0, manipulated.length - c.length);
}
if (manipulated.startsWith(c)) {
manipulated = manipulated.substring(1);
}
});
return manipulated;
}