Another one, but slightly shorter

=IF(COUNT(RIGHT(A2,11)),LEFT(A2,LEN(A2)-6),A2)