
Write a program that receives a string, a search character, and a replacement character, then substitutes only the last matching character found in the string.
./last_replace "we shipped on vibes again" "a" "o"Expected result
we shipped on vibes agoinFor your own tracking. Tests grade your code.
./last_replace "reloaed" "e" "i"Expected result
reloaid./last_replace "cursor" "x" "y"Expected result
cursor./last_replace "loop" "oo" "a" | cat -eExpected result
$Expected files
last_replace.cAllowed functions
write
Write a program that receives a string, a search character, and a replacement character, then substitutes only the last matching character found in the string.
./last_replace "we shipped on vibes again" "a" "o"Expected result
we shipped on vibes agoinFor your own tracking. Tests grade your code.
./last_replace "reloaed" "e" "i"Expected result
reloaid./last_replace "cursor" "x" "y"Expected result
cursor./last_replace "loop" "oo" "a" | cat -eExpected result
$Expected files
last_replace.cAllowed functions
write
Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.
v0.40: Create exercises. Challenge the community.
Meet Studio →