← Unit 1 · all exercises
Saved in this browser only

Make it a hashtag

Return the text with every space turned into a dash.

String dashed(String text)

Solution.java
Loading editor…
Results

Examples

  • dashed(hello world) → hello-world
  • dashed(one two three) → one-two-three

There are also 3 hidden tests you can't see. Solve the problem, not the examples.