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

 

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

Write a RECURSIVE method that accepts a string and returns the string with dashes "-" inserted at the front of the string and between each character in the string. Your method MUST be recursive in a non-trivial way.


recursiveInsertDashes("this is a test") → "-t-h-i-s- -i-s- -a- -t-e-s-t"
recursiveInsertDashes("x") → "-x"
recursiveInsertDashes("") → ""

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

public String recursiveInsertDashes(String orig) { }

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

Copyright Nick Parlante 2017 - privacy