dropRightWhile method
Drops characters from the right while condition is true.
Implementation
String dropRightWhile(bool Function(String char) condition) {
var i = length - 1;
while (i >= 0 && condition(this[i])) {
i--;
}
return substring(0, i + 1);
}