For Example if this is my equation string,
IF(AND(x>0,x<100),5,IF(AND(x>101,x<200),6,10))
I want to count the no:of occurrences of "IF(" string in the equation.
E.g. this way:
def s = "IF(AND(x>0,x<100),5,IF(AND(x>101,x<200),6,10))"
assert 2 == s.count("IF(")
In more advanced example you would probably need to use regex.