How do I write an if statement that searches for a similarity, rather than a direct result?
For example, I want to search for labels that begin with ABC:
if(label == 'ABC') //but I have two other labels: 'ABC1' and 'ABC2'
Is there a way to do something like: (if label like 'ABC'), instead of three separate if statements? I know I could else if() if I need to, but I want to avoid hard coding labels since they can be added, deleted, updated, etc.
Thank you.
Aucun commentaire:
Enregistrer un commentaire