String prevElement()
Returns a String containing the previous element.
DtpNoElementAtPositionException - If there is no previous element.
You can use prevElement(), along with nextElement(), to navigate the elements (tokens) in a DtpSplitString object. The first time you call nextElement(), the element position is zero. Subsequent calls to nextElement()increment the position by one. The prevElement() method returns the previous element and decrements the element position by one.
// Create a DtpSplitString object DtpSplitString MyString = new DtpSplitString("This,is a test",", "); // This call returns element 0 containing "This" String firstElement = MyString.nextElement() // This call returns element 1 containing "is" String secondElement = MyString.nextElement() // This call returns element 0 containing "This" String anotherElement = MyString.prevElement()