id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > test2024_09_19_P1SLHL_belowTotal
prev  |  next  |  chance

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)

public String test2024_09_19_P1SLHL_belowTotal(String orig, int remove, int move) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 220

Copyright Nick Parlante 2017 - privacy