1
I have a string of a Logical Expression
Ex:
((T ∨ F → T) ∧ (T → F)) → (∼F → T)
I need to remove the blanks from the string and join them as a result:
((T∨F→T)∧(T→F))→(∼F→T)
How can I do this in Java? I tried using replaceAll("\\s","");
but I was unsuccessful.
Utilize
string.replaceAll(" ", "");
orstring.replaceAll("\\s", "");
– Valdeir Psr
You sure are spaces?
– Sorack
Strings are immutable in Java, so the method will generate a new variable. You are storing this new variable?
– Jefferson Quesado
It ended up working, I believe it was some mistake of mine when creating the method, it worked with the string.replaceAll(" s", ""); thank you very much!
– Gabriel Longatti