about | help | code help+videos | done | prefs |
Write a method that returns the middle part of a string. The middle part is either the character in the middle of the string if it has an odd number of characters, or the middle two characters if the string has an even number of characters. Look at the test data for examples. You may assume that the input parameter string will have at least one character (no empty strings). jan11_2016_APSLHLmiddleString("x") → "x" jan11_2016_APSLHLmiddleString("ab") → "ab" jan11_2016_APSLHLmiddleString("test") → "es" ...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: 280
Copyright Nick Parlante 2017 - privacy