Code example for CharacterIterator

Methods: getEndIndexsetIndex

0
 
    /** 
     * @see UCharacterIterator#setToLimit() 
     */ 
    public void setToLimit() { 
        iterator.setIndex(iterator.getEndIndex());
    } 
 
    /** 
     * @see UCharacterIterator#getText(char[]) 
     */ 
    public int getText(char[] fillIn, int offset){
        int length =iterator.getEndIndex() - iterator.getBeginIndex(); 
        int currentIndex = iterator.getIndex();
        if(offset < 0 || offset + length > fillIn.length){
            throw new IndexOutOfBoundsException(Integer.toString(length));
        } 
     
        for (char ch = iterator.first(); ch != CharacterIterator.DONE; ch = iterator.next()) {
            fillIn[offset++] = ch;
Experience pair programming with AI  Get Codota for Java