removeEnd method

  1. @useResult
String removeEnd(
  1. String end
)

Returns a new string with end removed from the end, if it exists.

Implementation

@useResult
String removeEnd(String end) => endsWith(end) ? substringSafe(0, length - end.length) : this;