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

 

dsawyer@methacton.org string_packet_level_1 > portion
prev  |  next  |  chance

Given a string and two integers, return that portion of the string between those two indices (including the letters at those indices). Assume that the first index is less than or equal to the second. Also assume that the indices are valid and not out-of-bounds.


portion("window", 1, 2) → "in"
portion("ceiling", 2, 5) → "ilin"
portion("door", 0, 0) → "d"

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

public String portion( String s, int index1, int index2 ){ }

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

Copyright Nick Parlante 2017 - privacy