core/src/main/java/com/orientechnologies/common/parser/OStringParser.java
public static int jump(final CharSequence iText, int iCurrentPosition, final int iMaxPosition, final String iJumpChars) {
    if (iCurrentPosition < 0)
      return -1;

    final int size = iMaxPosition > -1 ? Math.min(iMaxPosition, iText.length()) : iText.length();
    final int jumpCharSize = iJumpChars.length();
    boolean found = true;
    char c;
    for (; iCurrentPosition < size; ++iCurrentPosition) {
      found = false;
      c = iText.charAt(iCurrentPosition);
      for (int jumpIndex = 0; jumpIndex < jumpCharSize; ++jumpIndex) {
        if (iJumpChars.charAt(jumpIndex) == c) {
          found = true;
          break;
        }
      }

      if (!found)
        break;
    }

    return iCurrentPosition >= size ? -1 : iCurrentPosition;
  }
public static int jump(final CharSequence iText, int iCurrentPosition, final int iMaxPosition, final String iJumpChars) {
    if (iCurrentPosition < 0)
      return -1;

    final int size = iMaxPosition > -1 ? Math.min(iMaxPosition, iText.length()) : iText.length();
    final int jumpCharSize = iJumpChars.length();
    boolean found = true;
    char c;
    for (; iCurrentPosition < size; ++iCurrentPosition) {
      found = false;
      c = iText.charAt(iCurrentPosition);
      for (int jumpIndex = 0; jumpIndex < jumpCharSize; ++jumpIndex) {
        if (iJumpChars.charAt(jumpIndex) == c) {
          found = true;
          break;
        }
      }

      if (!found)
        break;
    }

    return iCurrentPosition >= size ? -1 : iCurrentPosition;
  }
public static int jump ( final CharSequence iText , int iCurrentPosition , final int iMaxPosition , final String iJumpChars ) { if ( iCurrentPosition < 0 ) return - 1 ; final int size = iMaxPosition > - 1 ? Math . min ( iMaxPosition , iText . length ( ) ) : iText . length ( ) ; final int jumpCharSize = iJumpChars . length ( ) ; boolean found = true ; char c ; for ( ; iCurrentPosition < size ; ++ iCurrentPosition ) { found = false ; c = iText . charAt ( iCurrentPosition ) ; for ( int jumpIndex = 0 ; jumpIndex < jumpCharSize ; ++ jumpIndex ) { if ( iJumpChars . charAt ( jumpIndex ) == c ) { found = true ; break ; } } if ( ! found ) break ; } return iCurrentPosition >= size ? - 1 : iCurrentPosition ; }
Jump some characters reading from an offset of a String.

@param iText
String to analyze
@param iCurrentPosition
Current position in text
@param iMaxPosition
Maximum position to read
@param iJumpChars
String as char array of chars to jump
@return The new offset inside the string analyzed
Jump some characters reading from an offset of a String .