ensurePrefix method

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

Returns this string with prefix prepended if not already present. Audited: 2026-06-12 11:26 EDT

Implementation

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