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

 

Warmup-1 > front22
prev  |  next  |  chance

Given a string, take the first 2 chars and return the string with the 2 chars added at both the front and back, so "kitten" yields"kikittenki". If the string length is less than 2, use whatever chars are there.


front22("kitten") → "kikittenki"
front22("Ha") → "HaHaHa"
front22("abc") → "ababcab"

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

public String front22(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: 142.0

Copyright Nick Parlante 2017 - privacy