I want to check if a set of characters are part of String variable are not, Ideally I would do one of the below,
- Store the characters in a list and loop through each character to check if they exist in the string.
- Form a simple if statement with OR operations in case the character set is small.
Is there a better way to do this, may be using LINQ.
As an example I want to check if any of the characters '>' or '<' or '=', are part of the string 'a > b and b != 10'.
Aucun commentaire:
Enregistrer un commentaire