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

 

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

Write a method that returns the input parameter string, but with the first and last characters swapped. Look at the test data for examples. As a precondition, you may assume that the input parameter string has at least two characters.


test2020_10_01_P1SLHL_swapLetters("welcome") → "eelcomw"
test2020_10_01_P1SLHL_swapLetters("Xa") → "aX"
test2020_10_01_P1SLHL_swapLetters("Fast programming is not always good programming.") → ".ast programming is not always good programmingF"

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

public String test2020_10_01_P1SLHL_swapLetters(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: 250

Copyright Nick Parlante 2017 - privacy