Java Replace Last Character In String