Assuming the string has at least one character in it. If the string length is odd, then you may assume it returns (−1)/2
characters where n
represents how many characters are in the original string.
For example:
'small' => 'sm'
I would also like to write another function that returns the 2nd half of a string.