Depalindromize this string!

Given a palindrome generated according to this challenge, depalindromize it.

Test cases

abcdedcba -> abcde
johncenanecnhoj -> johncena
ppapapp -> ppap
codegolflogedoc -> codegolf


Remember, this is , so the code with the fewest bytes wins.

• -1 for the pointless restriction on your code not being a palindrome. It adds nothing to the challenge IMO, in very few languages would it matter. – Rɪᴋᴇʀ Nov 2 '16 at 23:56
• +1 for the restriction. It´s so mirroring the paliondrome challenge ... and it´s adding challenge to esolangs. I like it. Am I correct in the assumption that input will always have an uneven length? – Titus Nov 3 '16 at 0:04
• The non-palindrome restriction is probably a joke based on the previous challenge. Did anyone really downvote based on that? – Luis Mendo Nov 3 '16 at 0:27
• It does prevent single-byte solutions. @diynevala +1 for the unnecessary +1. – Adám Nov 3 '16 at 10:29
• What if the string is not a palindrome to begin with? – Xavon_Wrentaile Nov 3 '16 at 23:45

R, 35 bytes

Always late to the party.

substr(x<-scan(,""),1,nchar(x)/2+1)


Ruby, 20 bytes

->n{n[0,-~n.size/2]}


anonymous lambda that returns the first half (rounded up) of a string. The -~n is a 1+n with a higher priority than the division by two, so I don't need any parentheses. Unlike the other Ruby solution, this works on strings with even lengths.

Usage:

->n{n[0,-~n.size/2]}["abba"]
->n{n[0,-~n.size/2]}["abcba"]
->n{n[0,-~n.size/2]}["a"]


Returns:

"ab"
"abc"
"a"


Java 8, 33 bytes

Same logic as @Numberknot, but with 24 less bytes due to the use of lambdas. I tried to add this as an update to @Numberknot but with no response therefore I posted this as a separate answer since it's a big difference in bytes between his and my answer.

s->s.substring(0,s.length()/2+1);


Ungolfed version:

interface Func { String foo(String s); }

public class Main
{
public static void main(String[] args)
{
Func s = s->s.substring(0,s.length()/2+1);
}
}

• why -1? The other Java answers are pretty much the same only written in Java 7. Java 8 with the use of lambdas makes the answer shorter. – BananyaDev Nov 5 '16 at 20:44
• Probably because it looks like you just copied @Numberknot's answer, without giving him any credit... – Dada Nov 6 '16 at 9:57

Dyalog APL, 9 bytes

⊢↑⍨2÷⍨1+⍴


Thanks to Adám for saving 4 bytes.

• I just saw your answer now. You should know that constants are allowed as the left tine of a fork, so 2÷⍨ works. Since constants are only allowed as left tine, you can swap the arguments of commutative functions to make them permitted, so 1+⍴ works. For non-commutative functions, use ⍨. – Adám Nov 3 '16 at 10:53

OIL, 61 bytes

5
0
12
0
26
1
26
24
14
div
0
24
1
0
19
8
19
13
27

0
4
0
3

2


This uses the div from the standard library.

Japt, 5 bytes

¯ÒUÊz


Try it here