So basically I am creating a quiz for my Android app. However I have noticed that when the user types in the correct answer which is "angry" and has a space next to it the answer appears as wrong. I am wondering how I could change this so that white space after the answer does not get included? Thanks!
public void question3(View view) {
// Get the typed answer by the user and convert it to lower case.
EditText question3 = (EditText) findViewById(R.id.question3_typed);
String question3_answer = question3.getText().toString().toLowerCase();
if (question3_answer.equals("angry")) {
answer3 = "correct";
} else answer3 = "wrong";