Code example for StringCharacterIterator

Methods: currentgetBeginIndexgetEndIndexgetIndexnext

0
            fail("Assert 0: no null pointer");
        } catch (NullPointerException e) {
            // expected 
        } 
         
        StringCharacterIterator it = new StringCharacterIterator("testing");
		assertEquals("Wrong begin index", 0, it.getBeginIndex());
		assertEquals("Wrong end index", 7, it.getEndIndex());
		assertEquals("Wrong current index", 0, it.getIndex());
		assertEquals("Wrong current char", 't', it.current());
		assertEquals("Wrong next char", 'e', it.next());
    } 
 
    /** 
     * @tests java.text.StringCharacterIterator#StringCharacterIterator(java.lang.String, 
     *        int) 
     */ 
    public void test_ConstructorLjava_lang_StringI() { 
        StringCharacterIterator it = new StringCharacterIterator("testing", 3);
		assertEquals("Wrong begin index", 0, it.getBeginIndex());