removePrefix method

String removePrefix(
  1. String prefix
)

Removes the given prefix from the start of the string if it exists.

Example:

'prefix_text'.removePrefix('prefix_'); // 'text'

Implementation

String removePrefix(String prefix) => startsWith(prefix) ? substring(prefix.length) : this;