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.
|length of string||start of left||end of left||start of right||end of right|
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'? ;)
Junilu Lacar wrote:Assuming the method you write is named noMid(), here's some code you can use to test your implementation: