how can i make it so it can also remove the 2 middle characters if the word length is even??
i'm trying to do it without the if statement.
There are three kinds of actuaries: those who can count, and those who can't.
Stephan van Hulst wrote:You don't need a modulo operator. In fact, you don't need to determine at all whether the length is even or odd.
Piet Souris wrote:You do not need to determine the length.
L Hasan wrote:Do you think in this instance, the ternary operator counts as an 'if'? ;)
L.
Junilu Lacar wrote:Assuming the method you write is named noMid(), here's some code you can use to test your implementation:
Don't get me started about those stupid light bulbs. |