Java: easy rightmost char