Scripting function to search a string

I am looking for function that works similar to filter expression HAS.
Basically:

$if_A_contains_B_execute_C_otherwise_execute_D(A,B,C,D)

I've read syntax but I might have missed that one!

$ifgreater($strstr(A,B),0,C,D)