about | help | code help+videos | done | prefs |
quiz2022_03_01_APSLHL_replaceSpace
Write a method that returns string 'txt' but with all the spaces replaced with 'replacement'. As a precondition you may assume that a space will never be followed immediately by another space. Look at the test data for examples. quiz2022_03_01_APSLHL_replaceSpace("We might even replace single spaces with multiple characters!", "</>") → "We</>might</>even</>replace</>single</>spaces</>with</>multiple</>characters!" quiz2022_03_01_APSLHL_replaceSpace("Orlando City Lions", "!") → "Orlando!City!Lions" quiz2022_03_01_APSLHL_replaceSpace(" a space could be at the start and/or the end ", "~") → "~a~space~could~be~at~the~start~and/or~the~end~" ...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