about | help | code help+videos | done | prefs |
Write a method that returns a new version of the string 'orig', but with the first 'remove' characters removed from the string and the last 'move' characters moved to the front of the string. For example if 'orig' was "ABCDEFGH", 'remove' was 2, and 'move' was 1, you would return "HCDEFG" because the first 2 characters were removed, and 1 character was moved from the end to the beginning. Look at the test data for further examples. As pre-conditions, you may assume that none of the test data will generate errors if the method is programmed correctly. test2024_09_19_P1SLHL_belowTotal("klashfweoiyaejkhdgdas", 3, 5) → "dgdasshfweoiyaejkh" test2024_09_19_P1SLHL_belowTotal("ABC123", 0, 3) → "123ABC" test2024_09_19_P1SLHL_belowTotal("empty?", 6, 0) → "" ...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