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

 

mark


Write a method called mark that gets a string and a character, and returns a new string. This method marks the given character inside the given string by adding parenthesis around it e.g. mark("heLlo", 'l') --> he(L)(l)o Also, overload the method so it can accept one strings and a key as an int type e.g. mark("hello3", 3) --> hello(3)


mark("er1t", 1) → "er(1)t"
mark("2abc", 2) → "(2)abc"
mark("This is a test", "t") → "(T)his is a (t)es(t)"

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

public String mark(String value, String key) { }

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

Copyright Nick Parlante 2017 - privacy