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

 

amjadm@miamioh.edu assignmentiii > getSubstring
prev  |  next  |  chance

Given a string str, two int values, and a boolean value, write a method that works similar to the String.substring method if the given boolean value is true.
Example: getSubstring("hello!", 0, 2, true) --> "he".
If the boolean value is false, return a new string starting from the first given int value all the way to the end of the string.
Example: getSubstring("hello!", 0, 2, false) --> "hello!".


getSubstring("abc", 0, 1, true) → "a"
getSubstring("000111222", 0, 3, false) → "000111222"
getSubstring("Hello", 0, 4, true) → "Hell"

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

public String getSubstring(String str, int start, int end, boolean check) { }

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

Copyright Nick Parlante 2017 - privacy