question: private boolean stringMatch ( String str , OcrResultIterator iter ) { OcrResultIterator iterCopy = new OcrResultIterator ( iter ) ; for ( int pos = 0 ; pos < str . length ( ) ; ++ pos ) { if ( ! charMatch ( str . charAt ( pos ) , iterCopy . getCurrentChar ( ) ) ) return false ; if ( pos != str . length ( ) - 1 && ! iterCopy . hasNext ( ) ) return false ; iterCopy . moveToNext ( ) ; } return true ; }
target:  Returns true if string matches OcrResult from position pointed by iterator.