removeSuffix method

String removeSuffix(
  1. String suffix
)

Removes suffix from the end of this string if present.

Implementation

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