This question already has an answer here:
- Comparing chars in Java 11 answers
Is there a shorter way to represent this condition, like compare if last(char) is equal to '!', '.',and '?'
if (last == '[!]' || last == '.' || last == '?') {
...
}
Tried looking for the answer here but couldn't find it.
Aucun commentaire:
Enregistrer un commentaire