Create a function that takes a string and returns that string with the first half lowercased and the last half uppercased.
Example:
foobar => fooBAR
If the string length is an odd number then 'round' it up to find which letters to uppercase. See example below.
sillycase("brian")
// --^-- midpoint
// bri first half (lower-cased)
// AN second half (upper-cased)
PHP,
90888093 bytesSo I made the assumption that PHP warnings aren't allowed, and I should write a function that takes the complete string and returns the complete string.
In attempting another method involving a loop I came up with this, but it's not as short (105 bytes):