0

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"?

2
  • what if text looks like abcVALUE -- match or no match? Commented Dec 17, 2020 at 19:10
  • match. it just cannot be iVALUE Commented Dec 17, 2020 at 19:19

1 Answer 1

1

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

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.