removeSuffix method

  1. @useResult
String removeSuffix(
  1. String suffix
)

Removes suffix from the end if present; otherwise returns this.

Implementation

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