about | help | code help+videos | done | prefs |
Write a method that accepts a string as an input parameter and returns the string in reverse order with dashes between each character in the string. Do NOT put a dash at the beginning or end of the string. Look at the test data for examples. When writing this method, the only string mehtods you may use are: .length .substring .charAt .equals NOTE: It is possible to do the body of this entire method in one relatively clean line of code, so don't overcomplicate things! crazyBuildString("testing") → "g-n-i-t-s-e-t" crazyBuildString("run for the hills") → "s-l-l-i-h- -e-h-t- -r-o-f- -n-u-r" crazyBuildString("x") → "x" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 310
Copyright Nick Parlante 2017 - privacy