dropRightWhile method

String dropRightWhile(
  1. bool condition(
    1. String char
    )
)

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);
}