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

 

amjadm@miamioh.edu assignment3part1 > changeFirstMiddleLast
prev  |  next  |  chance

Given a string with odd length, switch the position of the first, middle, and last character. Put the first character in the middle, and at the same time put the middle character at the end, and put the last character at the beginning. For instance if str = "hello" the result should be "oehll"


changeFirstMiddleLast("a") → "a"
changeFirstMiddleLast("abc") → "cab"
changeFirstMiddleLast("a**b**c") → "c**a**b"

...Save, Compile, Run (ctrl-enter)

public String changeFirstMiddleLast(String str) { }

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: 200

Copyright Nick Parlante 2017 - privacy