I have a quick question in regards to using .Contains(). I'm writing an if statement and need to update a text field if it contains "VA". However, if it contains "IVA" it shouldn't update this field. What would be the best way to make sure I capture anything with "VA" except for "IVA"?

  • what if text looks like abcVALUE -- match or no match?
    – cropredy
    Dec 17 '20 at 19:10
  • match. it just cannot be iVALUE
    – verycold
    Dec 17 '20 at 19:19

You could do this with regex but a simple solution is:

if (myString.contains('VA') && !myString.contains('IVA')) {
    ... do field update
  • thank you! knew it was something simple but couldn't figure it out lol
    – verycold
    Dec 17 '20 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.