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

 

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

Write a method that returns a string made up of two copies of the string in 'str' with a dash between them. For example, if 'str' is "Hello", then you would return "Hello-Hello". Look at the test data for more examples.


test2023_09_08_APP1SLHL_makeTwo("Once") → "Once-Once"
test2023_09_08_APP1SLHL_makeTwo("a") → "a-a"
test2023_09_08_APP1SLHL_makeTwo("wonderful!") → "wonderful!-wonderful!"

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

public String test2023_09_08_APP1SLHL_makeTwo(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