contains() public method

Test whether a given token contains s. notie that this function directly operates on the byte content of the token to avoid string creation
public contains ( int index, String s ) : bool
index int
s String
return bool
Ejemplo n.º 1
0
 private bool contains(VTDNav vn)
 {
     String s2 = argumentList.next.e.evalString(vn);
     if (argumentList.e.NodeSet)
     {
         int a = evalFirstArgumentListNodeSet(vn);
         if (a == -1)
             return false;
         try
         {
             int t = vn.getTokenType(a);
             if (t != VTDNav.TOKEN_STARTING_TAG && t != VTDNav.TOKEN_DOCUMENT)
                 return vn.contains(a, s2);
             else
                 return vn.XPathStringVal_Contains(a, s2);
         }
         catch (Exception e)
         {
             return false;
         }
     }
     String s1 = argumentList.e.evalString(vn);
     //return s1.contains(s2);
     return s1.IndexOf(s2) != -1;
     //return (s1.i))
 }