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

 

amjadm@miamioh.edu assignment3 > moveLeft
prev  |  next  |  chance

Given a string str, and a character ch, move all occurrences of the given character to the beginning of the given string. For instance: if str = "student", and ch = 't', the value of "ttsuden" should be returned as a new string. If there is no occurrence of the given character inside the str, return the str.


moveLeft("sky", "s") → "sky"
moveLeft("sky", "y") → "ysk"
moveLeft("initIal", "i") → "iintIal"

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

public String moveLeft(String str, char ch) { }

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

Copyright Nick Parlante 2017 - privacy