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

Java > 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         

See also Java Example Code. Java help docs: If Boolean Logic | Strings | While and For Loops | Arrays and Loops


prev  |  next  |  chance   |  CodingBat  >  Warmup-1

Forget It! -- delete my code for this problem

New just for fun
 Random User Progress Graphs
 Random Epic Graphs 142.0

Copyright Nick Parlante 2006-11 - privacy