You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: string_operations.rb
    path of file: ./repos/truffleruby/src/main/ruby/truffleruby/core/truffle
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# Copyright (c) 2017, 2024 Oracle and/or its affiliates. All rights res
    
    def self.gsub_new_offset(orig, match)
      start_pos = Primitive.match_data_byte_begin(match, 0)
      end_pos = Primitive.match_data_byte_end(match, 0)
      if start_pos == end_pos
        if char = Primitive.string_find_character(orig, start_pos)
          start_pos + char.bytesize
        else
          start_pos + 1
        end