about | help | code help+videos | done | prefs |
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. e.g. substring("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. e.g. substring("hello!", 0, 2, false) --> "hello!". substring("abc", 0, 1, true) → "a" substring("Hello", 0, 4, true) → "Hell" substring("a", 0, 0, true) → "" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 100 Post-solution available
Copyright Nick Parlante 2017 - privacy