Try something like this:-
<s:if test="string1.indexOf(string2) != -1">
True
</s:if>
EDIT
As per your update, variable representation in IF
condition is wrong.
It should be represented with #
symbol
<s:set name="string" value="%{'test'}" />
<s:set name="string1" value="%{'result'}" />
<s:if test="%{#counter.indexOf(#counter1) == -1}">
<font size="5" color="green">String Not Found.</font>
</s:if>
<s:else>
<font size="5" color="green">String Found.</font>
</s:else>
In your code, there is no counter
related variable.
Your condition should be
<s:if test="%{#string.indexOf(#string1) == -1}">