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

 

test2021_04_29_SLHL_insertSymbols


Write a method that returns a string representing an integer 'num' with the string 'str' inserted BETWEEN each digit of the number. Preconditions: 'num' will contain a positive integer and 'str' will contain a string (possibly an empty string). Return a string with the digits of 'num' with 'str' between each digit. If 'num' is a single-digit number, just return a string that represents that number since there are no spaces between digits in a single-digit number.


test2021_04_29_SLHL_insertSymbols(124, ":::") → "1:::2:::4"
test2021_04_29_SLHL_insertSymbols(21532, "^") → "2^1^5^3^2"
test2021_04_29_SLHL_insertSymbols(4, "igloo") → "4"

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

public String test2021_04_29_SLHL_insertSymbols(int num, 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: 250

Copyright Nick Parlante 2017 - privacy