jeudi 22 octobre 2015

Multiple char comparison in if statement; condition [duplicate]

This question already has an answer here:

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