copy method

StringView copy()

Create a copy of this StringView, with an identical buffer and index.

Implementation

StringView copy() {
  StringView res = StringView(buffer)
    ..history = history
    ..index = index;
  return res;
}