Replace pointer arithmetic with StringRef::substr.