removePrefix method
If this String starts with the given prefix
, returns a copy of this
string with the prefix removed. Otherwise, returns this String.
Implementation
String removePrefix(String prefix) {
if (startsWith(prefix)) {
return substring(prefix.length, length);
} else {
return this;
}
}