I have the code below. the if condition is true and it goes into the line inside the IF but when I inspect answerText later, it still has the new line at the end
if(answerText.endsWith("\n")){
answerText = answerText.substring(0, answerText.length()-2);
}
answerText = answerText.trim()
public String trim()
Returns a copy of the string, with leading and trailing whitespace omitted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With