stripPrefix method

Option<Slice<T>> stripPrefix(
  1. Slice<T> prefix
)

Returns a subslice with the prefix removed. Returns none if the prefix is not present.

Implementation

Option<Slice<T>> stripPrefix(Slice<T> prefix) {
  if (startsWith(prefix)) {
    return Some(Slice(_list, _start + prefix._end - prefix._start, _end));
  }
  return None;
}