about | help | code help+videos | done | prefs |
Write a method that replaces the beginning of the 'longer' string with the 'shorter' string, while leaving the rest of the string unchanged. Look at the test data for examples! I did this in one line! (Don't make it harder that it is) As preconditions you may assume that 'longer' is longer than 'shorter'. test2022_01_20_APSLHL_putStr("ab", "A") → "Ab" test2022_01_20_APSLHL_putStr("Maximum strength", "Minimum") → "Minimum strength" test2022_01_20_APSLHL_putStr("Boop beep beep tweeeal. Beep boop beep shweee bloop.", "Quiet R2!") → "Quiet R2! beep tweeeal. Beep boop beep shweee bloop." ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 220
Copyright Nick Parlante 2017 - privacy