def str_insert(original, insert, index)
      assert_type original, :String, :string
      assert_type insert, :String, :insert
      assert_integer index, :index
      assert_unit index, nil, :index
      insertion_point = if index.to_i > 0
                          [index.to_i - 1, original.value.size].min
                        else
                          [index.to_i, -original.value.size - 1].max
                        end
      result = original.value.dup.insert(insertion_point, insert.value)
      Sass::Script::Value::String.new(result, original.type)
    end
def str_insert(original, insert, index)
      assert_type original, :String, :string
      assert_type insert, :String, :insert
      assert_integer index, :index
      assert_unit index, nil, :index
      insertion_point = if index.to_i > 0
                          [index.to_i - 1, original.value.size].min
                        else
                          [index.to_i, -original.value.size - 1].max
                        end
      result = original.value.dup.insert(insertion_point, insert.value)
      Sass::Script::Value::String.new(result, original.type)
    end
Inserts `$insert` into `$string` at `$index`.

 Note that unlike some languages, the first character in a Sass string is
 number 1, the second number 2, and so forth.

 @example
   str-insert("abcd", "X", 1) => "Xabcd"
   str-insert("abcd", "X", 4) => "abcXd"
   str-insert("abcd", "X", 5) => "abcdX"

 @overload str_insert($string, $insert, $index)
   @param $string [Sass::Script::Value::String]
   @param $insert [Sass::Script::Value::String]
   @param $index [Sass::Script::Value::Number] The position at which
     `$insert` will be inserted. Negative indices count from the end of
     `$string`. An index that's outside the bounds of the string will insert
     `$insert` at the front or back of the string
 @return [Sass::Script::Value::String] The result string. This will be
   quoted if and only if `$string` was quoted
 @raise [ArgumentError] if any parameter is the wrong type