[Question]
  [
Take the string `abcdfghjk`. To overwrite it, starting from `f`, with the string `wxyz`, you would continue along the original, replacing each character with the one from the replacement string. The result would be `abcdwxyzk`.
Now, consider a string which would be too long to fit, like `lmnopqrs`. Starting at `f` you would get `abcdlmnop`, then hit the end of the string. In order to continue, you wrap back to the beginning, resulting in `qrsdefghi`. With a long enough string, you could even wrap around multiple times.
**Task:**
You should take three inputs: the original string, the replacement string, and an index to start replacing at. This can be zero or one indexed.
**Test Cases:**
```
"This is a string"  "That"                  0   ->  "That is a string"
"This is a string"  "That"                  5   ->  "This That string"
"This is a string"  "That"                  14  ->  "atis is a striTh"
"hi"                "Hello there!"          0   ->  "e!"
"hi"                "Hello there!"          1   ->  "!e"
"over"              "write multiple times"  0   ->  "imes"
"over"              "write multiple times"  3   ->  "mesi"
```
**Other:**
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), shortest answer per language in bytes wins!
  
[Answer]
# [Python 3](https://docs.python.org/3/), 39 bytes
```
def f(x,y,z):
	for x[z%len(x)]in y:z+=1
```
[Try it online!](https://tio.run/##jc1BasMwEAXQdX2KqaGgoSLUpNkYvM8BugtZuHhsTy1LRp62ki/vyKWLEAoNCAb@f3xNUXpn9@vaUAutCjrqBcvsoXUewml5MmRVwDNbiOXyXBVrBxWYenxvaggaooalBPUbDGWaGDQYnkVFTB1C2snz3YdjqwZE9VMFxCybPFtRncrfep4hvRpmSVmXa0hZLem@JHiPO9zpitdr2PNWHckYB9KTp8fbL/8UxbVwX@Q38@1ZCMZPIzwZAuGR5tu1f@wecb0A "Python 3 – Try It Online")
-5 bytes thanks to ovs for spotting the trick with cleverly using python's for loop specifics
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
Ż¡sL}o@ƒ
```
[Try it online!](https://tio.run/##y0rNyan8///o7kMLi31q8x2OTfr//79SSEZiiRKIyixWAKJEheKSosy8dKX/hiYA "Jelly – Try It Online")
## How it works
Take some of the examples (the two `"over", "write multiple times"` and `"This is a string" "That", 14`), and "layer" them, as though overwriting. At the end, the lowest letter in each column is taken:
```
over    over    This is a string
writ       w                  Th
e mu    rite    at
ltip     mul
le t    tipl
imes    e ti
        mes
imes    mesi    atis is a striTh
```
We reshape the inputs into a matrix like this, then take the final character in each column. In order to offset the "overwriting" string, and to make the final replacement easier, we don't prepend spaces, instead `0`s
```
Ż¡sL}o@ƒ - Main link. Takes R on the left and O on the right, i third
 ¡       - Do the following i times to R:
Ż        -   Prepend 0 to R
    }    - To O:
   L     -   Length of O, L
  s      - Slice into rows of length L
       ƒ - Reduce columnwise by the following, starting with O:
     o@  -   Reversed logical OR, taking the final element,
              or the first, if all zero
```
[Answer]
# Scratch 3.0, 37 blocks / 262 bytes
[![enter image description here](https://i.stack.imgur.com/xmNNu.png)](https://i.stack.imgur.com/xmNNu.png)
As ScratchBlocks syntax:
```
define(L)(y)(x)
set[a v]to(1
set[l v]to(length of(L
repeat(l
add(letter(a)of(L))to[T v
change[a v]by(1
end
set[a v]to((y)mod(l
set[! v]to(1
repeat(length of(x
replace item((a)+(1))of[T v]with(letter(!)of(x
change[! v]by(1
set[a v]to(((a)+(1))mod(length
end
say(T
```
I am very glad Scratch has a modulo block built-in, otherwise this would have been pain.
[Try it on Scratch!](https://scratch.mit.edu/projects/512090649/)
[Answer]
# vim, ~~33~~ 30 bytes
Thanks for the sweet golf @kops
Pure vim answer, the TIO link is to V, which is a superset of vim. Takes input in 3 lines: index, original string, replacement string. Final buffer is "replaced string" output. 1-indexed.
```
D3gJhmd@"|qqmm`dlD`mR"|@qq@q
```
```
D3gJhmd@"|qqmm`dlD`mR<C-r>"<esc>|mm@qq@q # with unprintables shown
```
[Try it online!](https://tio.run/##K/v/38U43SsjN8VBqaawMDc3ISXHJSE3SEhJusahsNCh8P9/E678stQirvKizJJUhdzSnJLMgpxUhZLM3NRiAA "V (vim) – Try It Online")
[Bonus 14 byte V answer, but vim is cooler](https://tio.run/##K/v/P93LJbficEPN4U2HJyRU5LjU/P8fkpFZrABEiQrFJUWZeelcIRmJJf8NTQE "V (vim) – Try It Online")
[Answer]
# [J](http://jsoftware.com/), 31 30 bytes
```
1 :'-@u|.[[`((|i.)~&#)`]}u|.]'
```
[Try it online!](https://tio.run/##fY7NCoJAFEb3PcVnQeNASlJthCAIokWraBdCEtdmwjJ0rE316jY12h/i4i7m3HMusy/aLosw9sHQQx@@HsfFdLmYFR585kzyq7teb2z7Kl1@73b4JrhpFLCCt2grErCVCBVkhhCZSuVxx@D4hjLYfUT8@dD7b@Wdavjqa9JRYxqqb74SP6k3bGzJMvac4jiBEpQ@SflXISvNolrN@9PkgTIjXlKpCIc8VvIUE5TZlHeTM6VVorlsTAafpHgA "J – Try It Online")
Surprisingly hard to find a decent golf in J, given how simple the problem is.
This is a J adverb, modifying the index, and taking the main string as the right arg and the replacement string as the left arg. Eg:
```
'That' (5 f) 'This is a string'
```
This would have been the perfect place to use the semidual version of under `u&.(a:`v)`, but it cost more bytes than explicitly doing the rotation and its reverse.
## how
```
                     u|.]  NB. Rotate by index
                   }~      NB. Replace:
                 `]        NB. String with
      [`                   NB. Replacement chars
        ((|i.)~&#)         NB. At indexes 0...<str len>
                           NB. Each modded by <replacement len>
-@u|.                      NB. Unrotate by index
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 36 bytes
```
(a,b,i)=>b.map(c=>a[i++%a.length]=c)
```
[Try it online!](https://tio.run/##nZGxTsMwEIb3PMXVEopNUpcKmKpkQ0IMMNCtDaqTuslVThwlpgzAs4draEVpWYply7779f3ns9dqo9qswdoNK7vU3SrquArTEEUUp7JUNc@iWM0wCC6UNLrKXZFEmegcRLDw2LTAFmgqaF2DVc4AKKcc7cfjitYw3um/mLNsbn9sCOi9/mMzvtnZKHfITAuyKfAEYPfaGAuu0I0esD@aouxZ4HgPDjSBdqObI5S9Neg0lK/GYW00OCx1yw4q9vFZ6PUepRCZt5DUcMmFbGuDjvvzyhf9jxuIYjB0dFnBR2z2wpJL9jFfBqNciInn5Mo2d4o0PlMhpCFgCDoRW@rdA3rJCGZSyofnp0dZq6bVXIlkQkp6qqTfCpJykEWxTa74zr6PMlu11mhpbM6pxImTFgkE4PshKLm2WHHf3972U0y6Lw "JavaScript (Node.js) – Try It Online")
Input two strings as array of characters. Input the integer as 0-indexed. Modify the first string in-place.
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 79 bytes
```
param($x,$y,$i)$y|% t*y|%{$x=$x.remove(($n=$i++%$x.length),1).insert($n,$_)};$x
```
[Try it online!](https://tio.run/##DYlBCoMwEAC/EmSFpAZB6K34C@8lh8UsxCibpY1U374NDHOYOfYvcomYkuoROGwWqofTAzk4r97Io/kHdYY6Mm77B62FPAMNQ99SwrxKdH5yI@WCLG16eLv7BVVVuyVSMY1gijDltdMlBtHp@Qc "PowerShell – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 50 bytes
```
f(x,y,z)char*x,*y;{for(;*y;z++)x[z*=x[z]>0]=*y++;}
```
[Try it online!](https://tio.run/##dY9NTsMwEIXX8SmGIFB@BtQCZROVNQfoLgQpOE5tyUkq26WOq3D1YBc2RVSyZkbfvPds07stpfPcJhZHdCnltcosZmNxbAeVFH5weZ7a0mVrX6qXRbXOxjwvpvla9FTuGwaxNo0Y7nlMzpAUH4ER0RvoatEnKRxJFC4AWz6sniuE8dQLCBJXkOjAhWSQfGla920S35TvWOFvbd76GMF6E8KtS09hUXh2AC717minfFDw6R9tgBOZ5g0XGvypQRsv2eKG1wYX5H@@usCXT4QLfGVSDmA4U@zKR/wlSzJ8MoUHJQyDbi@N2PkfGdEx7dWXd4/kGw "C (gcc) – Try It Online")
-45 bytes thanks to dingledooper with a lot of golfing from someone who actually knows C :P (also inlining `++`, which i forgot about because python doesn't have that)  
-1 byte thanks to tsh with a clever trick to set `z` to 0 if `x[z]` is 0, which happens with the null byte after the end of the string
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 19 [bytes](https://github.com/abrudz/SBCS)
Assumes `⎕IO←0`.
```
{⍺@((⍴⍵)|⍺⍺+⍳⍴⍺)⊢⍵}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///v/pR7y4HDY1HvVse9W7VrAHygEj7Ue9msMguzUddi4AStf/THrVNeNTb96ir@VHvGqDcofXGj9omPuqbGhzkDCRDPDyD/wNpT3@gOgMu9ZCMxBJ1BQ0DhTRNBSAns1gBiBIVikuKMvPS1eHypgTkDU1wKfBIzcnJVyjJSC1KVYRblJGJKWOIkCkvyixJVcgtzSnJLMhJVSjJzE0thuvNL0stwq3GGKEGAA "APL (Dyalog Unicode) – Try It Online")
A dop which takes the index as the left operator operand `⍺⍺`, the original string as right input `⍵` and the replacement string as a left input `⍺`.
`⍳⍴⍺` generate the indices of the replacement string.  
`⍺⍺+` add the index offset to each index.  
`(⍴⍵)|` each index modulo the length of the original string.  
`⍺@(...)⊢⍵` place the replacement string at those indices in the original string.
[Answer]
# [R](https://www.r-project.org/), 81 bytes
```
function(o,r,i,`?`=utf8ToInt,`!`=nchar){p=?o;p[1+(i-1+1:!r)%%!o]=?r;intToUtf8(p)}
```
[Try it online!](https://tio.run/##pdDBSsQwEAbgu08xGVlo2SwYVBCX2Kve60mEliVrBrpJmU71ID57jUWwrXipIZBhJv9HCA/x1fEbkzg7HPtwEIohi5o16aqobC/HmzI@BNGVqmw4@Jrz99YWcd8@mW1GO7M1t4rzzUbFZ1vwnoKU8TGlsjb/@MEzLD11kHYNnTCFF9QAqVkLwmKlwUU6cjiH3d33pVnybC17PWdTbLT/y5qrCVvLNFn6GesJf6Xx3jVNBPGOncK/PiGNVkNmCik3g75KXELjDE59I9Q2DoROrsPli8bmaupySqUe4fAJ "R – Try It Online")
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), ~~103~~ 78 bytes
```
^.+
$*
(1)*(¶(?<-1>.)*)(.*)¶
$2$3$2
+`¶.(.*)¶(.)
1¶$1$2¶
+`1¶(.*)(.)
¶$2$1
G`.
```
[Try it online!](https://tio.run/##JcoxDsIwDEbh/T9FBg92Iiw5MCI6cgEkNpQMFURIHdqcLQfIxUIr1u@9da5lyWO8NIA82MRzbzxdT3ZT8cLqpTdQpDNFhNSb/olVYL2RUdx7SHbQ8Qt2jWS4Jx3DLnh@cnVlc9ltdS3fecLy1scP "Retina 0.8.2 – Try It Online") Takes the 0-indexed index on the first line. Explanation:
```
^.+
$*
```
Convert the index to unary.
```
(1)*(¶(?<-1>.)*)(.*)¶
$2$3$2
```
Prefix the replacement string with the original string up to the index. This was inspired by @Wezl's sed answer. (Previously I was rotating the original string to bring the index to the beginning.)
```
+`¶.(.*)¶(.)
1¶$1$2¶
```
Rotate the original string, replacing it with characters from the replacement string, keeping track of the number of characters rotated.
```
+`1¶(.*)(.)
¶$2$1
```
Rotate the original string back to its initial position.
```
G`.
```
Remove the now empty working lines.
[Answer]
# GNU sed [<4.3](https://codegolf.stackexchange.com/questions/51323/tips-for-golfing-in-sed#comment268984_51352) `-E`, ~~125 124~~ 117 bytes
Takes `offset-0-based-unary-~tildes@replacement#textontape` like `~~~~~~~~~~@banana made of mush#This is a tape made of text`. The input tape and replacement cannot contain tilde `~`, at `@`, or hash `#` characters.
```
s/(.*)@/@\1/
:
s/^(.*)@~(.*#\1(.))/\1\3@\2/
t
s/.*@#//
te
s/^(.*)@(.)(.*#\1)./\1\2@\3\2/
s/^(.*)@(.+#)\1$/@\2\1/
t
:e
```
## explanation
`~~~~~~~~~~@banana made of mush#This is a tape made of text`
```
s/(.*)@/@\1/
```
`@~~~~~~~~~~banana made of mush#This is a tape made of text`
`@` is the cursor, which marks the current character
```
:
```
start loop
```
s/^(.*)@~(.*#\1(.))/\1\3@\2/
```
When the cursor is before a tilde `~`, replace the `~` with the corresponding letter from the tape.
```
t
```
If a `~` was replaced, loop again. This works like so:
`@~~~~~~~~~~banana made of mush#This is a tape made of text`
`T@~~~~~~~~~banana made of mush#This is a tape made of text`
`Th@~~~~~~~~banana made of mush#This is a tape made of text`
...
`This is a @banana made of mush#This is a tape made of text`
```
s/.*@#//
te
```
If the cursor has reached the end of the replacement, finish by branching to `e`
```
s/^(.*)@([^~])(.*#\1)./\1\2@\3\2/
```
If the cursor is followed by a not `~` character, advance it and place that character on the tape. It finds its place in the tape with a backreference. Like so:
`This is a @banana made of mush#This is a tape made of text`
`This is a b@anana made of mush#This is a bape made of text`
`This is a ba@nana made of mush#This is a bape made of text`
...
`This is a banana made of mu@sh#This is a banana made of mu`
```
s/^(.*)@([^~]+)#\1$/@\2#\1/
```
If the cursor is at the end of the tape but not the end of the replacement text, remove the replacement text before the cursor so it is now at the start of the line. Like so:
`This is a banana made of mu@sh#This is a banana made of mu`
->
`@sh#This is a banana made of mu`
```
t
```
If either of these above two replacements worked, the work is not finished, loop again.
```
:e
```
The end label
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 8 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
║H┤1╫╢╘i
```
[Run and debug it](https://staxlang.xyz/#p=ba48b431d7b6d469&i=0+%22This+is+a+string%22+%22That%22%0A5+%22This+is+a+string%22+%22That%22%0A14+%22This+is+a+string%22+%22That%22%0A0+%22hi%22+%22Hello+there%21%22%0A1+%22hi%22+%22Hello+there%21%22%0A0+%22over%22+%22write+multiple+times%22%0A3+%22over%22+%22write+multiple+times%22&m=2)
input taken as `index, original, replacement`.
## Explanation
```
Fdix+n%%_& 
F          for each char in replacement:
 d         delete current iteration
  ix+      add iteration index and input index
     n%    get original's length
       %   modulo by that
           (this is needed because & extends the string when out of bounds)
        _  push current iteration value
         & replace at that index
```
[Answer]
# [Red](http://www.red-lang.org), 54 bytes
```
func[s r i][forall r[s/:i: r/1 i:(i % length? s)+ 1]s]
```
[Try it online!](https://tio.run/##ldE9C8IwEAbg2f6K14CgONSiLl1cncUtZCjt1RykH1xS/fm1VkWwU49Md/eQS06o6C9UaBOVKfqyq3PtIWCjy0Yy5yDaxymnkDgBp2vGCo7qW7An@M0WifGmH1opyy2@NMIQ6mrZYzgZfBCub2rMZUFhEjvMJsf5JDm8ieVJUZ3JuQbBktBSTQebQZIPae4kf0g9hAOh6lzg1hECV@TV75YZZB8Z3Q7vDSgx/jpeu1j0Tw "Red – Try It Online")
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 16 bytes
```
ＰＳＭＮ→ＦＳ«Ｆ¬ＫＫＭⅈ←ι
```
[Try it online!](https://tio.run/##S85ILErOT8z5/9@3NKcks6AoM69EwzOvoLQkuATITtfQ1LTm8s0vS4UI@pXmJqUWaWjqKFgFZaZnlAAl0/KLFNB0KFRzcYKF/fJLNAJSU7OBYpoKYFMiwHp9UtNAWjkDwNZlApm1//@HZySWKGQWKyQqFAMNyk615zI04cpL1wv5r1uWAwA "Charcoal – Try It Online") Link is to verbose version of code. Takes the index as the middle input. Explanation:
```
ＰＳ
```
Print the original string without moving the cursor.
```
ＭＮ→
```
Move to the desired index.
```
ＦＳ«
```
Loop over the characters of the replacement string.
```
Ｆ¬ＫＫ
```
If we reached the end of the original string...
```
Ｍⅈ←
```
... then move the cursor back to the beginning.
```
ι
```
Overwrite the original string with the current character of the replacement string.
[Answer]
# [Haskell](https://www.haskell.org/), 67 bytes
```
(s!l@(h:t))i|(a,b:c)<-splitAt i s=(a++h:c)!t$i+1|0<1=s!l$0
(s!_)_=s
```
[Try it online!](https://tio.run/##nZFBT4MwFIDv@xWl4UAzSCjoBWHRg4kHb@5mzFbdc32xwEKfetl/x8eyhW16maSE9IPvaxus8R/gXN9HPnC3kS1IKdxGJn4t3lSZ@I1DuiOBwleRmU4t04BCnOptWuqKnTCdsLpQi8r3tcGmWrUTIVxaJu/oCLpo2bR076BeymQmVRnO1kCP2MDwFXBZF8UTddisb54j1LHT6qXqwKw8RwaUxS4bkR5QHrt8RBmjNl6MIOf0hosUcjDATGFeVcOuhv31cm7RCx5G@N26Ughmhvh5fqV8J7P9@xNncknmesywsGv9J6Ov9hlDx87ccsbiL0E@8I9tBVnoIJB/HIrpRaI@iAGw2H5Bd6bK7w4JRP3pCDcOBGENXh6tuJtfpOYHlacofwA "Haskell – Try It Online")
The relevant function is `(!)`, which takes as input the original string `s`, the replacement string `l` and the index `i` (0-indexed).
## How?
Haskell is definitely the wrong tool for the job, since there is no easy way to replace a character at a given index in a string. As far as I can tell, the best way is to split the string `s` at index `i` in two parts, replace the first character of the second part, and then join them back.
To make up for the immutability of values in Haskell, we define the overwrite function recursively.
$$
\text{overwrite}(s,l,i)=
\begin{cases}
s&\text{if $l=\epsilon$},\\
\text{overwrite}(s,l,0)&\text{if $i\ge\text{length}(s)$},\\
\text{overwrite}(s',l[1:],i+1)&\text{where $s'=s$ except for $s'[i]=l[0]$}.
\end{cases}
$$
[Answer]
# Java, 41 bytes
```
(o,r,i)->{for(var c:r)o[i++%o.length]=c;}
```
Takes two char arrays and the index as input.
[Try it online!](https://tio.run/##jVLBSsNAED3brxgLQkLTYFEvhgoiiBdP9VZ6GNNJsnWzG2anqaX02@OmCdZCoQ4bkt158@blza6wxvFq@dVU60@tUkg1OgfvqAzsBuBDGSHOMCV4hR3UVi3BWV1TkBbI8wVYVrkyqCPoD5gq7eElGYnaav8s6TtMYH/gq1jVKAROUHy/rK311Nm0CWzEkQrHT7vMclAjQ/rIoZ2r0ejGxppMLsVimib7JumYOsU90UFZ6XUHM2Flcq8EOXdh/xttCDkJhh@FcuAX@soWOIzAn6H4922YDK4uoh7@hZrcH2GFahNvpLUFKYjp@rTZ2fzkmLc1cYvYsPLOlWstqtIEokpyp0wXkHdhZ93ZURwcPNB0DoKNoP/ifpLh0cx@2ghTsLHYF799ZsZt0LdoI4u7q4IR8CnG8/3BzbZOqIztWmKvyYg2gaFN3zzA8Ff1vvkB)
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~42~~ 39 bytes
```
->a,b,n{b.map{|c|a[n%a.size]=c;n+=1};a}
```
[Try it online!](https://tio.run/##hY3RCoIwFIbve4olhFBLkupK7LoH6E52cSZHN5hTtlmU@uxLwcCLQDjww/99/Me0/O3L1B9vQDnVHY8qaLo@7yHTO4is/CBL80Qf0nhIYPBF@jPLDKJcgLGUz6nZPgyHzaYhRRY8hLRkPCDWGanLgJKxAzfmia0q13UlvsyOkFN7R6Vq4gQa3C5@/IXxDOsnmgm/jHRIqlY52SgkTlZoFxsr2pn5Lw "Ruby – Try It Online")
Taking 2 char arrays in input.
[Answer]
# VBA, 105 bytes
```
Function f(x,y,z)
For i=1 To Len(x)
Mid(x,(z Mod Len(x))+1,1)=Mid(y,i,1)
z=z+1
Next
MsgBox x
End Function
```
Chosen VBA instead of VBScript, because VBA has `Mid()` instruction, but VBScript lacks that.
-5 bytes thanks to @BrianJ
[Answer]
# [Icon](https://github.com/gtownsend/icon), 55 bytes
```
procedure f(s,r,i)
!r:=:s[i%*s+1]&i+:=1&\z
return s
end
```
[Try it online!](https://tio.run/##ndHBCoJAEAbgu08xLSRu7sGlugjee4Bu1UF0zAFdZXYt6OXNOqlFYMucZubjZ1jKGtP3LTcZ5h0jFIFVrEh6K46T2J5ovbGhvvgUxon2zw@P0XVswHpo8pGrUzKB9O5MDoMiEMeSLAyVgnVM5ioUwNBMnYDpUxDJ3@4rGxzspYT/pN6NM0sS8w1xwKpqwJXIuBIjGU0yl0g9kc0NWczkewh1VzlqKwRHNVrxkblEboczX//0BA "Icon – Try It Online")
`procedure`, `return` and `end` add a lot to the bytecount :)
[Answer]
# [Perl 5](https://www.perl.org/) `-lF`, 38 bytes
```
$i=<>;$F[$i++%@F]=$_ for<>=~/./g;say@F
```
[Try it online!](https://tio.run/##K0gtyjH9/18l09bGzlrFLVolU1tb1cEt1lYlXiEtv8jGzrZOX08/3bo4sdLB7f///LLUIi5jrvKizJJUhdzSnJLMgpxUhZLM3NTif/kFJZn5ecX/dX1N9QwMDf7r5rgBAA "Perl 5 – Try It Online")
Input is on three lines:
```
original string
offset
replacement string
```
[Answer]
# [Rust](https://www.rust-lang.org/), 129 bytes
This is about as close as I could get while maintaining safety
```
|mut x:Vec<u8>,y:Vec<u8>,z:usize|->String{let l=x.len();(z..y.len()+z).for_each(|i|x[i%l]=y[i-z]);String::from_utf8(x).unwrap()};
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 50 bytes
```
o(v,e,r)char*v,*e;{for(;*e;r*=!!v[++r])v[r]=*e++;}
```
[Try it online!](https://tio.run/##jZA/T8MwEMX3fIpLGWInBlGgC1HFVImpSzOgphmCuTSW8k@OE4SqfPZwjjzAApUs@/nd791ZlrdnKee5ZaNAobkscx2OIsT4UrSaxSR0uPX9MY0infEx1dk2xCiKp7k3uVESbALehyLdrB@y2Lv5wEI1CAk7CDgK2AvYcbjAyYPeaNl9MWIFsAPnsTVbdz9y2vbO7AZj2zKbqDtH7DiHFwjeAniG4C4gcvI81Rioc9UwmuHR0FVSqh5o5Xacas4rAeTlhs57J3@V@X@pzSKptkSvTa2fSNP//KgnpYuVyoKvWFUtmBI1@u5xJP4g1mT56Ih2RG2ZT60MQj1URnUVglE19q7bIq@iH6lEShE9zd8 "C (gcc) – Try It Online")
[Answer]
# [Julia 1.0](http://julialang.org/), ~~39~~ 32 bytes
```
a*b*c=b.|>i->a[mod1(c+=1,end)]=i
```
[Try it online!](https://tio.run/##nZLPTsQgEMbvPMUsp3ZdG@uuFxI2Hn2AvTUcKJ1YNvRPKKtr4rvXKdpEq5dKCDDzzfcjhDlfnNX5dRz1ttwaWWbvR3t71EXTVXlibmS@w7ZKlbRjwCEMIKFg/FTbAWhqGIK37TMHoJwOtC/H3bRE8YdhFePhi0HVEfQfRn6YGDp8N5xqYtT2VzV/Quc6CDV63PDlWyi1ypVHcYPk6l7QL3z81duA0FxcsL1DCLbBgc93xWCVbx9FOlvOFGOaPsx0zqEJWRJ/sBC7XKWs/Eu4J8GQMMd7xR4ziJ3BPOXPnW2zRKeMVXbonX5LCqFBlCBaEHjtCYYViGRytCkI03lPOfbZOh58JuXMPiiVjh8 "Julia 1.0 – Try It Online")
`a` and `b` are expected to be lists of characters, and the function mutates `a`
[Answer]
# TI-Basic, 51 bytes
```
Prompt Str1,Str2,I
Output(8,1,Str1
For(J,1,length(Str2
Output(8,remainder(I,length(Str1)),sub(Str2,J,1
End
```
Output is displayed. Uses 1-based indexing. Only works if the original string is 16 (or 26 on color calculators) or less characters long because of the limited screen width. Replace `remainder(I,length(Str1))` with `length(Str1)fPart(I/length(Str1))` (adds 4 bytes) if run on a calculator before the TI-84+/SE with the 2.53 MP OS.
---
Without using `Output(` (not limited by the screen size):
### 102 bytes
```
Prompt Str1,Str2,I
" "+Str1+" →Str3
For(J,1,length(Str2
1+remainder(I+J-2,length(Str1
sub(Str3,1,Ans)+sub(Str2,J,1)+sub(Str3,Ans+2,length(Str3)-Ans-1→Str3
End
sub(Str3,2,length(Str1
```
Output is stored in `Ans` and displayed. Uses 1-based indexing. Replace `remainder(I+J-2,length(Str1` with `length(Str1)fPart((I+J-2)/length(Str1` (adds 6 bytes) if run on a calculator before the TI-84+/SE with the 2.53 MP OS.
]