ensurePrefix method

  1. @useResult
String ensurePrefix(
  1. String prefix
)

Returns this string with prefix prepended if not already present.

Implementation

@useResult
String ensurePrefix(String prefix) => startsWith(prefix) ? this : prefix + this;