Examples of substring()


Examples of org.apache.http.util.CharArrayBuffer.substring()

    public void testSubstring() {
        CharArrayBuffer buffer = new CharArrayBuffer(16);
        buffer.append(" name:  value    ");
        assertEquals(5, buffer.indexOf(':'));
        assertEquals(" name", buffer.substring(0, 5));
        assertEquals("  value    ", buffer.substring(6, buffer.length()));
        assertEquals("name", buffer.substringTrimmed(0, 5));
        assertEquals("value", buffer.substringTrimmed(6, buffer.length()));
        assertEquals("", buffer.substringTrimmed(13, buffer.length()));
    }
   
View Full Code Here

Examples of org.apache.http.util.CharArrayBuffer.substring()

   
    public void testSubstringIndexOfOutBound() {
        CharArrayBuffer buffer = new CharArrayBuffer(16);
        buffer.append("stuff");
        try {
            buffer.substring(-2, 10);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException ex) {
            // expected
        }
        try {
View Full Code Here

Examples of org.apache.http.util.CharArrayBuffer.substring()

            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException ex) {
            // expected
        }
        try {
            buffer.substring(12, 10);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException ex) {
            // expected
        }
        try {
View Full Code Here

Examples of org.apache.http.util.CharArrayBuffer.substring()

            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException ex) {
            // expected
        }
        try {
            buffer.substring(2, 1);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException ex) {
            // expected
        }
        try {
View Full Code Here

Examples of org.apache.james.mime4j.util.CharArrayBuffer.substring()

   
    public void testSubstring() {
        CharArrayBuffer buffer = new CharArrayBuffer(16);
        buffer.append(" name:  value    ");
        assertEquals(5, buffer.indexOf(':'));
        assertEquals(" name", buffer.substring(0, 5));
        assertEquals("  value    ", buffer.substring(6, buffer.length()));
        assertEquals("name", buffer.substringTrimmed(0, 5));
        assertEquals("value", buffer.substringTrimmed(6, buffer.length()));
        assertEquals("", buffer.substringTrimmed(13, buffer.length()));
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.sql.DBDictionary.substring()

            }

            // if we can't use LIKE, we have to take the substring of the
            // first value and compare it to the second
            dict.assertSupport(pre != null, "StringLengthFunction");
            dict.substring(buf,
                new FilterValueImpl(sel, ctx, bstate.state1, _val1),
                new ZeroFilterValue(sel, state),
                new StringLengthFilterValue(sel, ctx, bstate.state2, pre,post));
            buf.append(" = ");
            _val2.appendTo(sel, ctx, bstate.state2, buf, 0);
View Full Code Here

Examples of org.apache.poi.hwpf.model.TextPiece.substring()

                currentTextStart = currentPiece.getStart ();
                currentTextEnd = currentPiece.getEnd ();
            }

            if (runEnd < currentTextEnd) {
                String str = currentPiece.substring(runStart - currentTextStart, runEnd - currentTextStart);
                finalTextBuf.append(str);
            } else if (runEnd > currentTextEnd) {
                while (runEnd > currentTextEnd) {
                    String str = currentPiece.substring(runStart - currentTextStart,
                            currentTextEnd - currentTextStart);
View Full Code Here

Examples of org.apache.poi.hwpf.model.TextPiece.substring()

            if (runEnd < currentTextEnd) {
                String str = currentPiece.substring(runStart - currentTextStart, runEnd - currentTextStart);
                finalTextBuf.append(str);
            } else if (runEnd > currentTextEnd) {
                while (runEnd > currentTextEnd) {
                    String str = currentPiece.substring(runStart - currentTextStart,
                            currentTextEnd - currentTextStart);
                    finalTextBuf.append(str);
                    if (textIt.hasNext()) {
                        currentPiece = (TextPiece) textIt.next ();
                        currentTextStart = currentPiece.getStart ();
View Full Code Here

Examples of org.apache.poi.hwpf.model.TextPiece.substring()

                        currentTextEnd = currentPiece.getEnd ();
                    } else {
                        return;
                    }
                }
                String str = currentPiece.substring(0, runEnd - currentTextStart);
                finalTextBuf.append(str);
            } else {
                String str = currentPiece.substring(runStart - currentTextStart, runEnd - currentTextStart);
                if (textIt.hasNext()) {
                    currentPiece = (TextPiece) textIt.next();
View Full Code Here

Examples of org.apache.poi.hwpf.model.TextPiece.substring()

                    }
                }
                String str = currentPiece.substring(0, runEnd - currentTextStart);
                finalTextBuf.append(str);
            } else {
                String str = currentPiece.substring(runStart - currentTextStart, runEnd - currentTextStart);
                if (textIt.hasNext()) {
                    currentPiece = (TextPiece) textIt.next();
                    currentTextStart = currentPiece.getStart();
                    currentTextEnd = currentPiece.getEnd();
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.