Code example for StringCharacterIterator

Methods: getEndIndex

0
        notes = "", 
        method = "first", 
        args = {} 
    ) 
    public void test_first() { 
        StringCharacterIterator fixture = new StringCharacterIterator("fixture");
        assertEquals('f', fixture.first());
        fixture.next();
        assertEquals('f', fixture.first());
        fixture = new StringCharacterIterator("fixture", 1);
        assertEquals('f', fixture.first());
        fixture = new StringCharacterIterator("fixture", 1, "fixture".length(),
                2); 
        assertEquals('i', fixture.first());
 
        StringCharacterIterator it1 = new StringCharacterIterator("testing", 2,
                6, 4); 
        assertEquals("Wrong first char", 's', it1.first());
        assertEquals("Wrong next char", 't', it1.next());
        it1 = new StringCharacterIterator("testing", 2, 2, 2);
        assertTrue("Not DONE", it1.first() == CharacterIterator.DONE);