Call getText() instead of toString().trim().